PieceArray Class Reference

Array-like structure to hold pieces. More...

#include <old_board.h>

List of all members.

Public Member Functions

void add (coord_t)
 Add piece position to array.
void del (coord_t)
 Delte piece from array.
void clear ()
 Remove all elements.
uint getLen () const
coord_t operator[] (uint) const
string toString () const
 Representation.
coord_t getRandom () const
 Random square in piece array.

Private Attributes

coord_t elems [MAX_PIECES]
uint len


Detailed Description

Array-like structure to hold pieces.

This class is used to hold squares where pieces for one of the players are positioned, order of pieces is not fixed, just their presence is ensured.


Member Function Documentation

void PieceArray::add ( coord_t  elem  ) 

Add piece position to array.

Adds to the end in constant time.

void PieceArray::del ( coord_t  elem  ) 

Delte piece from array.

Goes through array, when found deletes item and replaces empty space with item from the end.


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

Generated on Thu Aug 6 23:29:08 2009 for akimot by  doxygen 1.5.7.1