Step Class Reference

One step of a player. More...

#include <board.h>

Inheritance diagram for Step:

StepWithKills

List of all members.

Public Member Functions

 Step (stepType_t, player_t)
 Step (stepType_t, player_t, piece_t, coord_t, coord_t)
 Step (stepType_t, player_t, piece_t, coord_t, coord_t, piece_t, coord_t, coord_t)
player_t getPlayer () const
bool isPass () const
bool isNull () const
bool isSingleStep () const
bool isPushPull () const
int count () const
 Actual step count.
Step toNew () const
 Temporary converter to new steps.
bool inversed (const Step &) const
 Checks (pseudo)inversion to given step.
bool pieceMoved () const
 Checks whether step moves any piece.
bool operator== (const Step &) const
bool operator< (const Step &) const
void setValues (stepType_t, player_t, piece_t, coord_t, coord_t)
void setValues (stepType_t, player_t, piece_t, coord_t, coord_t, piece_t, coord_t, coord_t)
string toString () const
 Step string representation.

Protected Attributes

stepType_t stepType_
player_t player_
piece_t piece_
coord_t from_
coord_t to_
piece_t oppPiece_
coord_t oppFrom_
coord_t oppTo_

Private Member Functions

const string oneSteptoString (player_t, piece_t, coord_t, coord_t) const
 Handles print of step of one piece.

Friends

class Board
class Eval
class OB_Board
class ContextMove
class Move


Detailed Description

One step of a player.

Represents one of the following: single-step steps - i.e. move of the piece double-step steps - i.e. push/pulls pass moves no step moves - i.e. resignation


Member Function Documentation

int Step::count (  )  const

Actual step count.

Single == 1, push/pull == 2, NULL/PASS == 0

bool Step::inversed ( const Step s  )  const

Checks (pseudo)inversion to given step.

return True if steps have same type, inversed from/to oppfrom/oppto. false otherwise.

const string Step::oneSteptoString ( player_t  player,
piece_t  piece,
coord_t  from,
coord_t  to 
) const [private]

Handles print of step of one piece.

Push/pull move calls this method twice.

bool Step::pieceMoved (  )  const

Checks whether step moves any piece.

Returns:
false if step is STEP_PASS/STEP_NULL otherwise true.

Step Step::toNew (  )  const

Temporary converter to new steps.

For printing the old-like steps (from board). Now steps conforming to Board.


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

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