Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 7, 2018, 5:14:21 PM (5 years ago)
Author:
stadlero
Message:

Reinforcements counter works

File:
1 edited

Legend:

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

    r12160 r12170  
    1414        this->connections_string = "";
    1515    }
    16     WagnisGameboard::~WagnisGameboard(){}
     16    WagnisGameboard::~WagnisGameboard(){
     17        for(std::vector<WagnisProvince*>* vec: this->continents){
     18            delete vec;
     19        }
     20    }
    1721
    1822    void WagnisGameboard::XMLPort(Element& xmlelement,XMLPort::Mode mode){
     
    107111    }
    108112
     113    void WagnisGameboard::initializeContinents(){
     114        int maxconts=0;
     115        for(WagnisProvince* p:this->provs){
     116            if(p->getContinent() > maxconts){
     117                maxconts = p->getContinent();
     118            }
     119        }
     120        for(int i=0;i<=maxconts;i++){
     121            this->continents.push_back(new std::vector<WagnisProvince*>());
     122            for(WagnisProvince* p:this->provs){
     123                if(p->getContinent() == i){
     124                    this->continents[i]->push_back(p);
     125                }
     126            }
     127            orxout()<<"There are "<<this->continents[i]->size()<<" Provinces in Continent "<< i << endl;
     128        }
     129    }
     130
    109131    //Returns the parsed int and the offset encoded in an int. the upper 16bit(incl MSB) is the number
    110132    //and the lower 16 bits is the new n(after the last digit)
Note: See TracChangeset for help on using the changeset viewer.