diff options
| author | Charlie Blake | 2017-11-15 09:08:24 +0000 |
|---|---|---|
| committer | GitHub | 2017-11-15 09:08:24 +0000 |
| commit | 1ce1b7e4c805ecf2a29c37e7a25f772f98b50b52 (patch) | |
| tree | 9a9cfcd137c87fcca9373e47fb0aec3af5832502 /src/main/game/game_state.cpp | |
| parent | Merge pull request #22 from thecharlesblake/docs (diff) | |
| parent | Add cleanup logic to benchmark script (diff) | |
| download | metasol-1ce1b7e4c805ecf2a29c37e7a25f772f98b50b52.tar.gz metasol-1ce1b7e4c805ecf2a29c37e7a25f772f98b50b52.zip | |
Merge pull request #23 from thecharlesblake/benchmark-script
Benchmark script
Diffstat (limited to 'src/main/game/game_state.cpp')
| -rw-r--r-- | src/main/game/game_state.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/main/game/game_state.cpp b/src/main/game/game_state.cpp index 3e8d129..1814a41 100644 --- a/src/main/game/game_state.cpp +++ b/src/main/game/game_state.cpp @@ -82,20 +82,19 @@ game_state::game_state(int seed, const sol_rules& s_rules) : } } + // Creates the tableau piles + for (unsigned int i = 0; i < rules.tableau_pile_count; i++) { + tableau_piles.push_back(pile::tableau_factory(rules.build_ord)); + } + // Deal to the tableau piles (row-by-row) unsigned int t = 0; while (!deck.empty()) { card c = deck.back(); deck.pop_back(); - // For the first row we must create all the tableau pile vectors - if (t / rules.tableau_pile_count == 0) { - tableau_piles.push_back(pile::tableau_factory(rules.build_ord)); - } - // Add the randomly generated card to the tableau piles - tableau_piles[t % rules.tableau_pile_count].place(c); - t++; + tableau_piles[t++ % rules.tableau_pile_count].place(c); } // If there are foundation piles, create the relevant pile vectors |
