- Timestamp:
- Nov 28, 2018, 11:17:41 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/wagnis_HS18/src/modules/wagnis/WagnisGameboard.cc
r12124 r12130 12 12 WagnisGameboard::WagnisGameboard(Context* context) : StaticEntity(context){ 13 13 RegisterObject(WagnisGameboard); 14 this->connections_string = ""; 14 15 } 16 WagnisGameboard::~WagnisGameboard(){} 15 17 16 WagnisGameboard::~WagnisGameboard(){17 for(WagnisProvince* prov:this->provs){18 prov->destroy();19 }20 }21 18 void WagnisGameboard::XMLPort(Element& xmlelement,XMLPort::Mode mode){ 22 19 SUPER(WagnisGameboard, XMLPort, xmlelement, mode); … … 63 60 //Syntax: 32=7-8-4 , 2=33+5+7+1+4 64 61 void WagnisGameboard::initializeNeighbors(){ 62 65 63 std::string str = this->connections_string; 66 64 orxout() << "inizializing started" << endl; … … 69 67 unsigned int n = 0; 70 68 while(n < str.size()){ 71 orxout() << "test1" << endl;72 69 int tmp = parse_int(str,n); 73 n = tmp |0x0000FFFF;74 int origin_ID = tmp / (2<<16);70 n = tmp & 0x0000FFFF; 71 int origin_ID = tmp >> 16; 75 72 if(n == str.size() || str[n] != '='){ 76 73 orxout() << "Error while parsing neighbors-string: '=' expected at position: "<< n << endl; … … 81 78 n++; 82 79 tmp = parse_int(str,n); 83 n = tmp |0x0000FFFF;84 other_ID = tmp / (2<<16);80 n = tmp & 0x0000FFFF; 81 other_ID = tmp >> 16; 85 82 86 83 for(WagnisProvince* orig:this->provs){ … … 96 93 break; 97 94 } 98 }while( n < str.size() && str[n] == '+');95 }while((n < str.size()) && (str[n] == '+')); 99 96 if(n == str.size()) return; 100 while( n < str.size() && str[n] == ' ') n++;97 while((n < str.size()) && (str[n] == ' ')) n++; 101 98 if(n == str.size()) return; 102 99 if(str[n] != ','){
Note: See TracChangeset
for help on using the changeset viewer.