- Timestamp:
- Nov 3, 2014, 4:33:54 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.cc
r10091 r10105 78 78 #include "TowerTurret.h" 79 79 #include "TowerDefenseCenterpoint.h" 80 80 //#include "TDCoordinate.h" 81 81 #include "worldentities/SpawnPoint.h" 82 82 #include "worldentities/pawns/Pawn.h" … … 131 131 132 132 const int kInitialTowerCount = 3; 133 Coordinate initialTowerCoordinates[kInitialTowerCount] = {{3,2}, {8,5}, {12,10}};134 133 135 134 for (int i = 0; i < kInitialTowerCount; i++) 136 135 { 137 Coordinate coordinate = initialTowerCoordinates[i]; 138 addTower(coordinate.x, coordinate.y); 136 //{{3,2}, {8,5}, {12,10}}; old coordinates 137 TDCoordinate* coordinate = new TDCoordinate(i,(i*2)); 138 addTower(coordinate->x, coordinate->y); 139 139 } 140 140 … … 144 144 } 145 145 146 void TowerDefense::addEnemy(){} 147 148 146 149 void TowerDefense::end() 147 150 { … … 150 153 ChatManager::message("Match is over"); 151 154 } 155 156 152 157 153 158 void TowerDefense::addTower(int x, int y) … … 184 189 185 190 // Add tower to coordinatesStack 186 Coordinate newTowerCoordinates = {x, y}; 191 TDCoordinate newTowerCoordinates; 192 newTowerCoordinates.x=x; 193 newTowerCoordinates.y=y; 194 195 187 196 addedTowersCoordinates_.push_back(newTowerCoordinates); 188 197 … … 205 214 bool TowerDefense::towerExists(int x, int y) 206 215 { 207 for(std::vector< Coordinate>::iterator it = addedTowersCoordinates_.begin(); it != addedTowersCoordinates_.end(); ++it)208 { 209 Coordinate currentCoordinates = (Coordinate) (*it);216 for(std::vector<TDCoordinate>::iterator it = addedTowersCoordinates_.begin(); it != addedTowersCoordinates_.end(); ++it) 217 { 218 TDCoordinate currentCoordinates = (TDCoordinate) (*it); 210 219 if (currentCoordinates.x == x && currentCoordinates.y == y) 211 220 return true;
Note: See TracChangeset
for help on using the changeset viewer.