Antiprism 0.23
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:
Inheritance graph
[legend]
Collaboration diagram for color_map_deal:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual bool init (const char *name, char *errmsg=0)
 Initialise from a string.
color_mapclone () 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:
idxthe 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:
namethe map name.
errmsgan 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: