aboutsummaryrefslogtreecommitdiff
path: root/src/main/input-output/output
diff options
context:
space:
mode:
authorCharlie Blake2018-06-10 00:30:55 +0100
committerGitHub2018-06-10 00:30:55 +0100
commitd82642305dbcf53262ff41705a41c6e7c1591161 (patch)
treeb2bbe8c0aadaec16280f020e55eb55955be43d3f /src/main/input-output/output
parentMerge pull request #58 from thecharlesblake/fin (diff)
parentFinish refactoring game state class (diff)
downloadmetasol-d82642305dbcf53262ff41705a41c6e7c1591161.tar.gz
metasol-d82642305dbcf53262ff41705a41c6e7c1591161.zip

Merge pull request #59 from thecharlesblake/paper-tidy-up

Paper tidy up

Diffstat (limited to 'src/main/input-output/output')
-rw-r--r--src/main/input-output/output/state_printer.cpp14
-rw-r--r--src/main/input-output/output/state_printer.h8
2 files changed, 11 insertions, 11 deletions
diff --git a/src/main/input-output/output/state_printer.cpp b/src/main/input-output/output/state_printer.cpp
index 0fdacae..9d13129 100644
--- a/src/main/input-output/output/state_printer.cpp
+++ b/src/main/input-output/output/state_printer.cpp
@@ -55,7 +55,7 @@ void state_printer::print_header(ostream& stream, const char* header) {
}
void state_printer::print_piles(ostream& stream,
- const vector<game_state::pile_ref>& pile_rs,
+ const vector<pile::ref>& pile_rs,
const game_state& gs) {
bool empty_row = false;
pile::size_type row_idx = 0;
@@ -65,7 +65,7 @@ void state_printer::print_piles(ostream& stream,
while (!empty_row) {
// Loops through the current row to determine if it is empty
empty_row = true;
- for (const game_state::pile_ref pile_r : pile_rs) {
+ for (const pile::ref pile_r : pile_rs) {
if (gs.piles[pile_r].size() > row_idx) {
empty_row = false;
break;
@@ -73,7 +73,7 @@ void state_printer::print_piles(ostream& stream,
}
if (!empty_row || row_idx == 0) {
// Loops through the current (non-empty) row, and outputs the values
- for (const game_state::pile_ref pile_r : pile_rs) {
+ for (const pile::ref pile_r : pile_rs) {
const pile& p = gs.piles[pile_r];
if (p.size() > row_idx) {
print_card(stream, p[p.size() - 1 - row_idx]);
@@ -90,11 +90,11 @@ void state_printer::print_piles(ostream& stream,
}
void state_printer::print_top_of_piles(ostream& stream,
- const vector<game_state::pile_ref>& vp,
+ const vector<pile::ref>& vp,
const game_state& gs) {
- vector<game_state::pile_ref> top(vp);
+ vector<pile::ref> top(vp);
- for (game_state::pile_ref p : top) {
+ for (pile::ref p : top) {
if (gs.piles[p].empty()) {
stream << "[]";
} else {
@@ -106,7 +106,7 @@ void state_printer::print_top_of_piles(ostream& stream,
}
void state_printer::print_top_of_pile(ostream& stream,
- const game_state::pile_ref pile_r,
+ const pile::ref pile_r,
const game_state& gs) {
print_top_of_piles(stream, {pile_r}, gs);
}
diff --git a/src/main/input-output/output/state_printer.h b/src/main/input-output/output/state_printer.h
index ae63182..2b2090b 100644
--- a/src/main/input-output/output/state_printer.h
+++ b/src/main/input-output/output/state_printer.h
@@ -7,7 +7,7 @@
#include <ostream>
-#include "../../game/game_state.h"
+#include "../../game/search-state/game_state.h"
class state_printer {
public:
@@ -16,12 +16,12 @@ public:
private:
static void print_header(std::ostream&, const char*);
static void print_piles(std::ostream&,
- const std::vector<game_state::pile_ref>&,
+ const std::vector<pile::ref>&,
const game_state&);
static void print_top_of_piles(std::ostream&,
- const std::vector<game_state::pile_ref>&,
+ const std::vector<pile::ref>&,
const game_state&);
- static void print_top_of_pile(std::ostream&, game_state::pile_ref,
+ static void print_top_of_pile(std::ostream&, pile::ref,
const game_state&);
static void print_card(std::ostream&, card);
};