Skip to content

Commit

Permalink
Merge pull request #4 from SharifAIChallenge/dev
Browse files Browse the repository at this point in the history
Add ApAddition to GameConstants
  • Loading branch information
MostafaOjaghi authored Feb 18, 2020
2 parents f5e8a8c + 12fc243 commit c5f7f5f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/src/Core/Message/Parse/InitMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ void InitMessage::update_game(Game *game) {

json json_game_const = root["gameConstants"];
game->game_constants_.max_ap_ = json_game_const["maxAP"];
game->game_constants_.ap_addition_ = json_game_const["apAddition"];
game->game_constants_.max_turns_ = json_game_const["maxTurns"];
game->game_constants_.turn_timeout_ = json_game_const["turnTimeout"];
game->game_constants_.pick_timeout_ = json_game_const["pickTimeout"];
Expand Down
4 changes: 4 additions & 0 deletions client/src/Model/GameConstants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ int GameConstants::getMaxAp() const{
return max_ap_;
}

int GameConstants::getApAddition() const {
return ap_addition_;
}

int GameConstants::getMaxTurns() const{
return max_turns_;
}
Expand Down
3 changes: 3 additions & 0 deletions client/src/Model/GameConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class GameConstants {

int getMaxAp() const;

int getApAddition() const;

int getMaxTurns() const;

int getTurnTimeout() const;
Expand All @@ -30,6 +32,7 @@ class GameConstants {

private:
int max_ap_;
int ap_addition_;
int max_turns_;
int turn_timeout_;
int pick_timeout_;
Expand Down

0 comments on commit c5f7f5f

Please sign in to comment.