Changeset 12160 for code/branches/wagnis_HS18/src/modules
- Timestamp:
- Dec 5, 2018, 7:51:11 PM (6 years ago)
- Location:
- code/branches/wagnis_HS18/src/modules/wagnis
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.cc
r12150 r12160 64 64 **/ 65 65 void Wagnis::playerFinishedStageCallback(WagnisPlayer* player){ 66 67 player->resetProvinceSelection(); 66 68 67 69 if(this->active_player != player->Player_ID){ … … 132 134 player->gameStage = ATTACK_STAGE; 133 135 this->gameStage = ATTACK_STAGE; 136 player->reinforcements = provincesOfPlayerCounter(player->Player_ID); 134 137 orxout()<<"Player "<<player->Player_ID<<"\'s turn. Attack."<<endl; 135 138 break; … … 170 173 } 171 174 172 //this->gameBoard->initializeNeighbors(); 173 174 //for(WagnisPlayer* p: this->players){ 175 //this->playerEntered(p); 176 //} 175 this->gameBoard->initializeNeighbors(); 177 176 178 177 orxout() << "Game creation finished" << endl; … … 198 197 } 199 198 }else{ 200 orxout()<<"Nullpointer found in provin es!!!"<<endl;199 orxout()<<"Nullpointer found in provinces!!!"<<endl; 201 200 } 202 201 } … … 212 211 } 213 212 }else{ 214 orxout()<<"Nullpointer found in provin es!!!"<<endl;213 orxout()<<"Nullpointer found in provinces!!!"<<endl; 215 214 } 216 215 } -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisGameboard.cc
r12132 r12160 64 64 orxout() << "String size:" << endl; 65 65 orxout() << str.size() << endl; 66 orxout() << str<<endl; 66 67 unsigned int n = 0; 67 68 while(n < str.size()){ … … 85 86 if(other->getID() == other_ID){ 86 87 orig->addNeighbor(other); 87 orxout() << "Added neighbor province "<< other_ID << " to province " << origin_ID << endl;88 //orxout() << "Added neighbor province "<< other_ID << " to province " << origin_ID << endl; 88 89 break; 89 90 } 90 91 } 91 92 } 92 break;93 93 } 94 94 }while((n < str.size()) && (str[n] == '+')); 95 95 96 if(n == str.size()) return; 96 97 while((n < str.size()) && (str[n] == ' ')) n++; … … 102 103 n++; 103 104 while(n < str.size() && str[n] == ' ') n++; 105 orxout()<<"One province finished"<<endl; 104 106 } 105 107 } -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisHUDinfo.cc
r12159 r12160 79 79 } 80 80 case REINFORCEMENT_STAGE: { 81 ss<<"Player "<<wagnisgame->active_player<<" place your reinforcements ";81 ss<<"Player "<<wagnisgame->active_player<<" place your reinforcements: "<<wagnisgame->players.at(wagnisgame->active_player-1)->reinforcements; 82 82 setCaption( ss.str() ); 83 83 break; -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc
r12150 r12160 47 47 this->province_selection_changed = true; 48 48 }else{ 49 if(this->origin_province != nullptr) this->origin_province->dehighlight(); 49 50 this->origin_province = prov; 51 this->origin_province->highlight(); 50 52 this->province_selection_changed = true; 51 53 } … … 82 84 this->reinforcements -= 1; 83 85 orxout()<<"Province "<<this->target_province->getID()<<" owned by Player "<<this->target_province->getOwner_ID()<<" troops: "<<this->target_province->getTroops()<<endl; 86 if(reinforcements == 0) master->playerFinishedStageCallback(this); 84 87 } 85 88 } … … 351 354 return this->is_active; 352 355 } 356 357 //Resets the two province pointers and dehighlights them. 358 void WagnisPlayer::resetProvinceSelection(){ 359 360 if(this->origin_province != nullptr)this->origin_province->dehighlight(); 361 if(this->target_province != nullptr)this->target_province->dehighlight(); 362 this->origin_province = nullptr; 363 this->target_province = nullptr; 364 } 353 365 } -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.h
r12150 r12160 38 38 void setActive(bool); 39 39 bool isActive() const; 40 void resetProvinceSelection(); 40 41 41 42 -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.cc
r12159 r12160 20 20 this->owner_ID = -1; 21 21 this->troops = 0; 22 this->setRadarName( std::to_string(0));22 this->setRadarName(""); 23 23 this->setRadarObjectColour(colour({128,128,128}, 100.0f)); 24 24 this->ID = -1; … … 81 81 this->setOwner_ID( this->getOwner_ID() ); 82 82 } 83 84 85 86 83 87 //set troops 84 88 void WagnisProvince::setTroops(int troops){
Note: See TracChangeset
for help on using the changeset viewer.