Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 7, 2018, 10:23:46 AM (6 years ago)
Author:
kunzro
Message:

gameboard string fixed

File:
1 edited

Legend:

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

    r12072 r12077  
    3838        orxout() << province->getID() << endl;
    3939        this->provs.push_back(province);
    40        
    41         if(province->getID() == 1000){
    42             orxout() << "You added a province with ID 1000.\nThis is the magic debug number.\nThe function to initialize the neighbors of all provinces will be called:" << endl;
    43             orxout() << "-----neighbors-----" << endl << endl;
    44             initializeNeighbors(this->connections_string);
    45         }
    4640    }
    4741    //XML get province
     
    6660
    6761    //Parses the string and initializes the neigbors vector of all provinces according
    68     //Syntax: 32=7-8-4  , 2=33-5-7-1-4
     62    //Syntax: 32=7-8-4  , 2=33+5+7+1+4
    6963    void WagnisGameboard::initializeNeighbors(std::string str){
    7064        orxout() << "inizializing started" << endl;
     
    7973            if(n == str.size() || str[n] != '='){
    8074                orxout() << "Error while parsing neighbors-string: '=' expected at position: "<< n << endl;
    81                 orxout() << "Correct syntax: 32=4-2-5-67, 54=8-1-12" << endl;
     75                orxout() << "Correct syntax: 32=4+2+5+67, 54=8+1+12" << endl;
    8276            }
    8377            int other_ID;
     
    10094                    break;
    10195                }
    102             }while(n < str.size() && str[n] == '-');
     96            }while(n < str.size() && str[n] == '+');
    10397            if(n == str.size()) return;
    10498            while(n < str.size() && str[n] == ' ') n++;
     
    106100            if(str[n] != ','){
    107101                orxout() << "Error while parsing neighbors-string: ',' expected at position: "<< n << endl;
    108                 orxout() << "Correct syntax: 32=4-2-5-67, 54=8-1-12" << endl;
     102                orxout() << "Correct syntax: 32=4+2+5+67, 54=8+1+12" << endl;
    109103            }
    110104            n++;
     
    123117        if(digit < 0 || digit > 9){
    124118            orxout() << "Error while parsing neighbors-string: Digit expected at position: "<< n << endl;
    125             orxout() << "Correct syntax: 32=4-2-5-67, 54=8-1-12" << endl;
     119            orxout() << "Correct syntax: 32=4+2+5+67, 54=8+1+12" << endl;
    126120        }
    127121
Note: See TracChangeset for help on using the changeset viewer.