Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12077


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

gameboard string fixed

Location:
code/branches/wagnis_HS18
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/wagnis_HS18/data/levels/Wagnis.oxw

    r12072 r12077  
    4848    <SpawnPoint position="100, 45, 75" lookat="0, 45, 75" />
    4949
    50 <WagnisGameboard position="0,0,0" connections_string="1=2,2=1-1000,1000=2  ">
     50<WagnisGameboard position="0,0,0" connections_string="1=2+1000, 2=1, 1000=1">
    5151
    5252  <Provinces>
     
    6969      </attached>
    7070    </WagnisProvince>
     71
    7172
    7273  </Provinces>
  • 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
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisGameboard.h

    r12072 r12077  
    3434        std::string getConnections_string() const;
    3535        //
    36 
     36        std::string connections_string;
    3737        void initializeNeighbors(std::string);
    3838
     
    4040    private:
    4141        std::vector<WagnisProvince*> provs;
    42         std::string connections_string;
     42       
    4343        int parse_int(std::string,unsigned int);
    4444    };
Note: See TracChangeset for help on using the changeset viewer.