Now the buttons actually do something - also added a build_type

This commit is contained in:
2011-07-03 10:12:47 -04:00
parent d04cde49c8
commit 793d6bd9a2
4 changed files with 67 additions and 15 deletions

View File

@ -31,6 +31,7 @@ GameData::GameData()
player1 = Player("player 1", PLAYER1_COLOUR);
player2 = Player("player 2", PLAYER2_COLOUR);
turn = &player1;
build_type = VERTEX_NONE;
}
GameData::~GameData() { }
@ -236,6 +237,9 @@ void GameData::set_mode(Mode m)
// Stay in MODE_SELECT (or maybe MODE_BUILD) when current is null
if (current == NULL) return;
// If we're leaving MODE_BUILD, we should set the build_type back to none
if (mode == MODE_ATTACK && m != mode) build_type = VERTEX_NONE;
// The other modes all require current to match the player
if (dynamic_cast<GameVertex*>(current)->player == turn) mode = m;
}