From fff4e0472b422e09f176c1deffdf4f0a30b15f4c Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Thu, 1 Feb 2018 12:59:29 +0000 Subject: Remove order on cache flag from game state --- src/main/game/game_state.cpp | 6 ------ src/main/game/game_state.h | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) (limited to 'src') diff --git a/src/main/game/game_state.cpp b/src/main/game/game_state.cpp index faab429..ad2ac3f 100644 --- a/src/main/game/game_state.cpp +++ b/src/main/game/game_state.cpp @@ -277,21 +277,16 @@ 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) { @@ -361,7 +356,6 @@ void game_state::eval_pile_order(list& pile_lst, pile_ref changed_pr, } #endif } -#endif //////////////////////// diff --git a/src/main/game/game_state.h b/src/main/game/game_state.h index 532eefc..27cb2c0 100644 --- a/src/main/game/game_state.h +++ b/src/main/game/game_state.h @@ -22,6 +22,7 @@ class game_state { friend class predicate; friend class hasher; friend class global_cache; + friend class cached_game_state; public: // Defines types typedef uint8_t pile_ref; @@ -58,11 +59,9 @@ private: // Private constructor explicit game_state(const sol_rules&); -#ifndef ORDER_ON_CACHE // Used to maintain pile order invariant void eval_pile_order(pile_ref, bool); void eval_pile_order(std::list&, pile_ref, bool); -#endif // Used in get_legal_moves() move get_stock_tableau_move() const; -- cgit v1.2.1