- Timestamp:
- Nov 7, 2018, 11:26:02 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxy.cc
r12064 r12086 205 205 void TixyTaxyTorxy::upgradeTower(int x, int y) 206 206 { 207 TixyTaxyTorxyCoordinate* coord = new TixyTaxyTorxyCoordinate(x,y);208 x = coord->GetX();209 y = coord->GetY();210 211 int cost = center_->getTowerCost(fields_[x][y]->getUpgrade() + 1);212 213 if (fields_[x][y]->isFree() == false && fields_[x][y]->canUpgrade() == true && getCredit() >= cost)214 {215 payCredit(cost);216 fields_[x][y]->upgrade();217 }207 // TixyTaxyTorxyCoordinate* coord = new TixyTaxyTorxyCoordinate(x,y); 208 // x = coord->GetX(); 209 // y = coord->GetY(); 210 211 // int cost = 100; 212 213 // if (fields_[x][y]->isFree() == false && fields_[x][y]->canUpgrade() == true && getCredit() >= cost) 214 // { 215 // payCredit(cost); 216 // fields_[x][y]->upgrade(); 217 // } 218 218 } 219 219 … … 234 234 selecter->buildTower_ = false; 235 235 236 if (getField(selecter->selectedPos_)->canUpgrade() == true) 237 { 238 upgradeTower(selecter->selectedPos_->GetX(), selecter->selectedPos_->GetY()); 239 } 240 else 241 { 242 addTower(selecter->selectedPos_->GetX(), selecter->selectedPos_->GetY()); 243 } 236 // if (getField(selecter->selectedPos_)->canUpgrade() == true) 237 // { 238 // upgradeTower(selecter->selectedPos_->GetX(), selecter->selectedPos_->GetY()); 239 // } 240 241 addTower(selecter->selectedPos_->GetX(), selecter->selectedPos_->GetY()); 242 244 243 } 245 244
Note: See TracChangeset
for help on using the changeset viewer.