- Timestamp:
- Dec 7, 2018, 5:14:21 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/wagnis_HS18/src/modules/wagnis/WagnisGameboard.cc
r12160 r12170 14 14 this->connections_string = ""; 15 15 } 16 WagnisGameboard::~WagnisGameboard(){} 16 WagnisGameboard::~WagnisGameboard(){ 17 for(std::vector<WagnisProvince*>* vec: this->continents){ 18 delete vec; 19 } 20 } 17 21 18 22 void WagnisGameboard::XMLPort(Element& xmlelement,XMLPort::Mode mode){ … … 107 111 } 108 112 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 109 131 //Returns the parsed int and the offset encoded in an int. the upper 16bit(incl MSB) is the number 110 132 //and the lower 16 bits is the new n(after the last digit)
Note: See TracChangeset
for help on using the changeset viewer.