Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 7, 2018, 7:51:28 PM (5 years ago)
Author:
kunzro
Message:

Colour untill 6 adjusted and CHOOSE_PROVINCE_STAGE fixed, so it only ends, if all the provinces are occupied also if some players don' play

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.cc

    r12170 r12172  
    1717    this->active_player = 1;
    1818    this->initial_reinforcements_left = 2; //changed here
    19     this->empty_provinces_left = 0;
    20 
    21     int n = 3;
     19
     20    int n = 6;
    2221    for(int i = 0;i < n;i++){
    2322        WagnisPlayer* p = new WagnisPlayer(context);
     
    4342
    4443    this->gameStage = CHOOSE_PROVINCE_STAGE;
    45     this->empty_provinces_left = this->provinceCount();
    4644    this->players.at(0)->gameStage = this->gameStage;
    4745    this->players.at(0)->setActive(true);
     
    7371        case CHOOSE_PROVINCE_STAGE:{
    7472            player->setActive(false);
    75             this->empty_provinces_left -= 1;
    76             if(this->empty_provinces_left > 0){
     73            if(this->unoccupiedProvinces() > 0){
    7774                //Still empty provinces left
    78                 orxout()<<"DEBUG: Empty provs: "<<this->empty_provinces_left<<endl;
    7975
    8076                if(this->active_player < this->players.size()){
     
    9187            }else{
    9288                //no empty provinces left
    93                 orxout()<<"DEBUG: Empty provs: "<<this->empty_provinces_left<<endl;
    9489                this->active_player = 1;
    9590                WagnisPlayer* next = this->players[this->active_player - 1];
     
    222217}
    223218
     219int Wagnis::unoccupiedProvinces(){
     220    int n = 0;
     221    for(WagnisProvince* p: this->gameBoard->provs){
     222        if(p != nullptr){
     223            if(p->getOwner_ID() == -1 && p->ID < 1000){
     224                n++;
     225            }
     226        }
     227    }
     228    return n;
     229}
     230
    224231int Wagnis::reinforcementsCounter(int player){
    225232    int n = 0;
Note: See TracChangeset for help on using the changeset viewer.