diff --git a/gamedata.cpp b/gamedata.cpp index cd69f77..951b49e 100644 --- a/gamedata.cpp +++ b/gamedata.cpp @@ -57,7 +57,7 @@ bool GameData::add_vertex(int x, int y, int r, int colour) if ((player == PLAYER1 && !player1_played) || (player == PLAYER2 && !player2_played)) { - Graph::add_vertex(x, y, r, colour); + Graph::add_vertex(x, y, r, colour, 10); if (player == PLAYER1) player1_played = true; if (player == PLAYER2) player2_played = true; toggle_turn(); @@ -66,7 +66,7 @@ bool GameData::add_vertex(int x, int y, int r, int colour) return false; } - if (Graph::add_vertex(x, y, r, colour, current)) + if (Graph::add_vertex(x, y, r, colour, 10, current)) { clear_current_vertex(); toggle_turn(); diff --git a/gamedata.h b/gamedata.h index 14e5408..979b007 100644 --- a/gamedata.h +++ b/gamedata.h @@ -10,6 +10,7 @@ enum Turn {PLAYER1, PLAYER2, WIN1, WIN2}; + class GameData : public Graph { public: diff --git a/graph.cpp b/graph.cpp index ea53c07..9608c0c 100644 --- a/graph.cpp +++ b/graph.cpp @@ -113,10 +113,11 @@ bool Graph::add_vertex(int x, int y, int r, int colour, int score, Vertex* src) } -Vertex::Vertex(int x, int y, int r, int colour) +Vertex::Vertex(int x, int y, int r, int colour, int score) { this->x = x; this->y = y; this->r = r; this->colour = colour; + this->score = score; }