Changeset 1d96513 in network-game for common/Game.cpp
- Timestamp:
- Dec 22, 2013, 2:57:04 AM (11 years ago)
- Branches:
- master
- Children:
- 45734ff
- Parents:
- 483a2cb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Game.cpp
r483a2cb r1d96513 37 37 } 38 38 39 map<unsigned int, Projectile>& Game::getProjectiles() { 40 return this->projectiles; 41 } 42 39 43 int Game::getRedScore() { 40 44 return this->redScore; … … 51 55 void Game::setId(unsigned int id) { 52 56 this->id = id; 57 } 58 59 void Game::setRedScore(int score) { 60 this->redScore = score; 61 } 62 63 void Game::setBlueScore(int score) { 64 this->blueScore = score; 53 65 } 54 66 … … 147 159 } 148 160 149 void Game::setRedScore(int score) { 150 this->redScore = score; 161 bool Game::addProjectile(Projectile p) { 162 if (projectiles.find(p.id) == projectiles.end()) { 163 projectiles[p.id] = p; 164 return true; 165 } 166 else 167 return false; 151 168 } 152 169 153 void Game::setBlueScore(int score) { 154 this->blueScore = score; 170 bool Game::removeProjectile(unsigned int id) { 171 if (projectiles.erase(id) == 1) 172 return true; 173 else 174 return false; 155 175 }
Note:
See TracChangeset
for help on using the changeset viewer.