Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/wagnis_HS18/src/modules/wagnis/WagnisGameboard.cc @ 12069

Last change on this file since 12069 was 12067, checked in by kunzro, 6 years ago

XML and CMake updated, Gameboard is working

File size: 1.2 KB
RevLine 
[12049]1#include "WagnisGameboard.h"
2#include "core/CoreIncludes.h"
3#include "BulletDynamics/Dynamics/btRigidBody.h"
4#include <vector>
5
6
7namespace orxonox
8{
9    RegisterClass(WagnisGameboard);
10   
11    WagnisGameboard::WagnisGameboard(Context* context) : StaticEntity(context){
12        RegisterObject(WagnisGameboard);
13    }
[12050]14
[12049]15    WagnisGameboard::~WagnisGameboard(){
[12050]16        for(WagnisProvince* prov:this->provs){
17            prov->destroy(); //destroys all Provinces
18        }
19    }
[12049]20
[12050]21
22
[12049]23    //XML Port
[12050]24    void WagnisGameboard::XMLPort(Element& xmlelement,XMLPort::Mode mode){
[12067]25        SUPER(WagnisGameboard, XMLPort, xmlelement, mode);
[12050]26
[12067]27        XMLPortObject(WagnisGameboard, WagnisProvince, "Provinces", addProvince, getProvince, xmlelement, mode);
[12049]28    }
[12050]29    //XML add province
30    //Adds a Province to the Gameboard
31    void WagnisGameboard::addProvince(WagnisProvince* province){
[12067]32        orxout() << "added" << endl;
33        orxout() << province->getID() << endl;
[12050]34        this->provs.push_back(province);
35    }
36    //XML get province
37    WagnisProvince* WagnisGameboard::getProvince(unsigned int index) const{
38        if(this->provs.size() <= index) return nullptr;
39        return this->provs.at(index);
40    }
[12049]41}
Note: See TracBrowser for help on using the repository browser.