Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 28, 2018, 11:17:41 PM (5 years ago)
Author:
stadlero
Message:

changed gametype from Deathmatch to Wagnis in Wagnis.oxw + some wip in Wagnis.cc

File:
1 edited

Legend:

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

    r12124 r12130  
    1212    WagnisGameboard::WagnisGameboard(Context* context) : StaticEntity(context){
    1313        RegisterObject(WagnisGameboard);
     14        this->connections_string = "";
    1415    }
     16    WagnisGameboard::~WagnisGameboard(){}
    1517
    16     WagnisGameboard::~WagnisGameboard(){
    17         for(WagnisProvince* prov:this->provs){
    18             prov->destroy();
    19         }
    20     }
    2118    void WagnisGameboard::XMLPort(Element& xmlelement,XMLPort::Mode mode){
    2219        SUPER(WagnisGameboard, XMLPort, xmlelement, mode);
     
    6360    //Syntax: 32=7-8-4  , 2=33+5+7+1+4
    6461    void WagnisGameboard::initializeNeighbors(){
     62       
    6563        std::string str = this->connections_string;
    6664        orxout() << "inizializing started" << endl;
     
    6967        unsigned int n = 0;
    7068        while(n < str.size()){
    71             orxout() << "test1" << endl;
    7269            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;
    7572            if(n == str.size() || str[n] != '='){
    7673                orxout() << "Error while parsing neighbors-string: '=' expected at position: "<< n << endl;
     
    8178                n++;
    8279                tmp = parse_int(str,n);
    83                 n = tmp | 0x0000FFFF;
    84                 other_ID = tmp / (2<<16);
     80                n = tmp & 0x0000FFFF;
     81                other_ID = tmp >> 16;
    8582
    8683                for(WagnisProvince* orig:this->provs){
     
    9693                    break;
    9794                }
    98             }while(n < str.size() && str[n] == '+');
     95            }while((n < str.size()) && (str[n] == '+'));
    9996            if(n == str.size()) return;
    100             while(n < str.size() && str[n] == ' ') n++;
     97            while((n < str.size()) && (str[n] == ' ')) n++;
    10198            if(n == str.size()) return;
    10299            if(str[n] != ','){
Note: See TracChangeset for help on using the changeset viewer.