Changeset 0678d60 in network-game for common/WorldMap.cpp
- Timestamp:
- Jan 22, 2014, 1:31:27 AM (11 years ago)
- Branches:
- master
- Children:
- 06fc7f7
- Parents:
- 204edcf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/WorldMap.cpp
r204edcf r0678d60 45 45 } 46 46 47 void WorldMap::createObjectsFromStructures() { 48 for (int y=0; y<this->height; y++) { 49 for (int x=0; x<this->width; x++) { 50 switch (this->getStructure(x, y)) { 51 case WorldMap::STRUCTURE_BLUE_FLAG: 52 this->addObject(WorldMap::OBJECT_BLUE_FLAG, x*25+12, y*25+12); 53 break; 54 case WorldMap::STRUCTURE_RED_FLAG: 55 this->addObject(WorldMap::OBJECT_RED_FLAG, x*25+12, y*25+12); 56 break; 57 case WorldMap::STRUCTURE_NONE: 58 break; 59 } 60 } 61 } 62 } 63 47 64 WorldMap::TerrainType WorldMap::getElement(int x, int y) 48 65 { … … 71 88 pos.y = 0; 72 89 73 for ( int x=0; x<vctStructures->size(); x++) {74 for ( int y=0; y<(*vctStructures)[x]->size(); y++) {90 for (unsigned int x=0; x<vctStructures->size(); x++) { 91 for (unsigned int y=0; y<(*vctStructures)[x]->size(); y++) { 75 92 if ((*(*vctStructures)[x])[y] == t) { 76 93 pos.x = x; … … 131 148 case WorldMap::OBJECT_RED_FLAG: 132 149 cout << "RED_FLAG" << endl; 150 break; 151 case WorldMap::OBJECT_NONE: 152 cout << "OBJECY_NONE" << endl; 133 153 break; 134 154 } … … 145 165 cout << "RED_FLAG" << endl; 146 166 break; 167 case WorldMap::OBJECT_NONE: 168 cout << "OBJECY_NONE" << endl; 169 break; 147 170 } 148 171 it->pos.x = x;
Note:
See TracChangeset
for help on using the changeset viewer.