aboutsummaryrefslogtreecommitdiff
path: root/src/main/game/game_state.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/game/game_state.cpp')
-rw-r--r--src/main/game/game_state.cpp30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/main/game/game_state.cpp b/src/main/game/game_state.cpp
index 8075f50..8f45a38 100644
--- a/src/main/game/game_state.cpp
+++ b/src/main/game/game_state.cpp
@@ -28,10 +28,7 @@ typedef sol_rules::stock_deal_type sdt;
// A private constructor used by both of the public ones. Initializes all of the
// piles and pile refs specified by the rules
-game_state::game_state(const sol_rules& s_rules) {
- game_state::static_reset();
- game_state::rules = s_rules;
-
+game_state::game_state(const sol_rules& s_rules) : rules(s_rules) {
// If there is a hole, creates pile
if (rules.hole) {
piles.emplace_back();
@@ -203,31 +200,6 @@ game_state::move::move(pile_ref f, pile_ref t, pile::size_type i)
}
-////////////////////////////
-// SETUP STATIC VARIABLES //
-////////////////////////////
-
-sol_rules game_state::rules;
-std::vector<game_state::pile_ref> game_state::tableau_piles;
-std::vector<game_state::pile_ref> game_state::cells;
-game_state::pile_ref game_state::stock;
-game_state::pile_ref game_state::waste;
-std::vector<game_state::pile_ref> game_state::reserve;
-std::vector<game_state::pile_ref> game_state::foundations;
-game_state::pile_ref game_state::hole;
-
-
-void game_state::static_reset() {
- tableau_piles.clear();
- cells.clear();
- stock = 0;
- waste = 0;
- reserve.clear();
- foundations.clear();
- hole = 0;
-}
-
-
/////////////////////////
// MODIFYING FUNCTIONS //
/////////////////////////