Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SwapCheck Namespace Reference

Determines whether to swap in the current game state. More...

Functions

bool PlaySwap (const Game &game, HexColor toPlay)
 If first move of game has been played and swap rule is being used, checks hardcoded swap rules and returns true if swap should be played.

Detailed Description

Determines whether to swap in the current game state.

Todo:
This functionality should be in the book.
Note:
Initialization is NOT THREADSAFE!

Function Documentation

bool SwapCheck::PlaySwap ( const Game game,
HexColor  toPlay 
)

If first move of game has been played and swap rule is being used, checks hardcoded swap rules and returns true if swap should be played.

Definition at line 72 of file SwapCheck.cpp.

References Game::AllowSwap(), Game::Board(), StoneBoard::Const(), FIRST_TO_PLAY, StoneBoard::Height(), HexAssert, Game::History(), LogInfo(), BoardUtils::Mirror(), StoneBoard::NumStones(), VERTICAL_COLOR, and StoneBoard::Width().

Referenced by WolveEngine::GenMove(), MoHexEngine::GenMove(), and BenzeneTestEngine::GenMove().


6 Jan 2011 Doxygen 1.6.3