List of all members
cwchess::Color Class Reference

A color (black or white). More...

#include <Color.h>

Inheritance diagram for cwchess::Color:
Inheritance graph
[legend]

Public Member Functions

Constructors
 Color (void)
 Construct an uninitialized Color object.
 
 Color (Color const& color)
 Copy-constructor.
 
 Color (ColorData color)
 Construct a Color object from a constant.
 
Assignment operators
Color&  operator= (Color const& color)
 Assign from another Color object.
 
Color&  operator= (ColorData color)
 Assign from a constant.
 
Accessors
bool is_white (void) const
 Return TRUE if this color is white.
 
bool is_black (void) const
 Return TRUE if this color is black.
 
uint8_t operator() (void) const
 Return the underlaying integral value.
 
Special functions
void toggle (void)
 Change the color from black to white or vica versa.
 
Visitors
Color opposite (void) const
 Return a Color object with the opposite color of this object.
 
uint8_t index (void) const
 Return a number that can be used as array index.
 
uint8_t forward_index_offset (void) const
 Return the index offset that advances one square in the direction of the pawns of this color.
 

Friends

Comparison operators
bool operator== (Color const& c1, Color const& c2)
 
bool operator== (Color const& c1, ColorData c2)
 
bool operator== (ColorData c1, Color const& c2)
 
bool operator!= (Color const& c1, Color const& c2)
 
bool operator!= (Color const& c1, ColorData c2)
 
bool operator!= (ColorData c1, Color const& c2)
 

Additional Inherited Members

- Protected Attributes inherited from cwchess::ColorData
uint8_t M_bits
 0000C000, where C=0 means black and C=1 means white.
 

Detailed Description

A color (black or white).

This class represents a chess color.

See ColorData for defined constants.

Definition at line 67 of file Color.h.


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

Copyright © 2006 - 2010 Carlo Wood.  All rights reserved.