Now the buttons actually do something - also added a build_type
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user