Antiprism 0.23

- Main Page
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions

# color_map_deal Class Reference

A colour map that maps index numbers to shuffled packs of numbers. More...

`#include <col_map.h>`

Inheritance diagram for color_map_deal:
[legend]
Collaboration diagram for color_map_deal:
[legend]

List of all members.

## Public Member Functions
virtual bool | init (const char *name, char *errmsg=0)
| Initialise from a string.
color_map * | clone () const
| Get a copy of the map.
virtual int | effective_size () const
| The effective size of the map.
virtual col_val | get_col (int idx) const
| Get the colour value for an index number.
void | shuffle ()
| shuffle the mapping

## Detailed Description

A colour map that maps index numbers to shuffled packs of numbers.

## Member Function Documentation

color_map* color_map_deal::clone | ( |  | ) | const`[inline, virtual]`

Get a copy of the map.

Returns:
  a pointer to the dynamically allocated copy, which must be freed by the caller with `delete`, 0 indicates that the clone failed.

Reimplemented from color_map.

virtual int color_map_deal::effective_size | ( |  | ) | const`[inline, virtual]`

The effective size of the map.

The effective size of a map is one greater than the highest index number in the map. It is the size of the smallest map (sequential, starting at 0) that will include all the entries of the map.

Returns:
  The effective size

Reimplemented from color_map.

col_val color_map_deal::get_col | ( | int | idx | ) | const`[virtual]`

Get the colour value for an index number.

Parameters:

  idx | the index.

Returns:
  The colour.

Reimplemented from color_map.

bool color_map_deal::init | ( | const char * | name,
|  | char * | errmsg = `0`
| ) |  | `[virtual]`

Initialise from a string.

Parameters:

  name | the map name.
  errmsg | an array at least `MSG_SZ` chars long to return any error message.

Returns:
  true if the file could be read, otherwise false and the error is detailed in errmsg.

Reimplemented from color_map.

The documentation for this class was generated from the following files:

- base/col_map.h
- base/col_map.cc