diff options
| author | thecharlesblake | 2018-01-30 19:48:52 +0000 |
|---|---|---|
| committer | thecharlesblake | 2018-01-30 19:48:52 +0000 |
| commit | 48f464b788ef0f2be539ec05b6e370ef46cfd015 (patch) | |
| tree | 786209868e2b2cc987498c7e52f338d1a18837aa /src/main/game/game_state.cpp | |
| parent | Add ORDER_ON_CACHE flag to CMake script (diff) | |
| download | metasol-48f464b788ef0f2be539ec05b6e370ef46cfd015.tar.gz metasol-48f464b788ef0f2be539ec05b6e370ef46cfd015.zip | |
Add logic for ORDER_ON_CACHE to game_state
Diffstat (limited to 'src/main/game/game_state.cpp')
| -rw-r--r-- | src/main/game/game_state.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/game/game_state.cpp b/src/main/game/game_state.cpp index ad2ac3f..faab429 100644 --- a/src/main/game/game_state.cpp +++ b/src/main/game/game_state.cpp @@ -277,16 +277,21 @@ void game_state::undo_move(const move m) { // reorders the pile refs so that the largest pile is first void game_state::place_card(pile_ref pr, card c) { piles[pr].place(c); +#ifndef ORDER_ON_CACHE eval_pile_order(pr, true); +#endif } // Same as above but for taking cards card game_state::take_card(pile_ref pr) { card c = piles[pr].take(); +#ifndef ORDER_ON_CACHE eval_pile_order(pr, false); +#endif return c; } +#ifndef ORDER_ON_CACHE // Assesses whether the pile ref that was modified was a tableau, cell or // reserve pile, and if so makes the relevant function call void game_state::eval_pile_order(pile_ref pr, bool is_place) { @@ -356,6 +361,7 @@ void game_state::eval_pile_order(list<pile_ref>& pile_lst, pile_ref changed_pr, } #endif } +#endif //////////////////////// |
