|
@@ -253,14 +253,18 @@ bool Game::lockOutRule(int player, Turn turn)
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-void Game::leftToRightRule(int player, int color, int index)
|
|
|
+bool Game::leftToRightRule(int player, Turn turn)
|
|
|
{
|
|
|
- // player must add an x to olok from left to right
|
|
|
- if(players[player].cumulativeOlok.getLastIndex(color) > index)
|
|
|
+ for(int i = 0; i<turn.moves.size(); i++)
|
|
|
{
|
|
|
- fprintf(stdout,"Player[%d] %s not following left to right rule X\n", player, players[player].savedName);
|
|
|
+ // player must add an x to olok from left to right
|
|
|
+ if(players[player].cumulativeOlok.getLastIndex(turn.moves[i].color) > turn.moves[i].index)
|
|
|
+ {
|
|
|
+ fprintf(stdout,"Player[%d] %s not following left to right rule X\n", player, players[player].savedName);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
- else{players[player].currentTurnOlok.addX(color, index);}
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
void Game::addX(int player, int color, int index)
|