Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

XML and CMake updated, Gameboard is working

File size: 1.2 KB
Line 
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    }
14
15    WagnisGameboard::~WagnisGameboard(){
16        for(WagnisProvince* prov:this->provs){
17            prov->destroy(); //destroys all Provinces
18        }
19    }
20
21
22
23    //XML Port
24    void WagnisGameboard::XMLPort(Element& xmlelement,XMLPort::Mode mode){
25        SUPER(WagnisGameboard, XMLPort, xmlelement, mode);
26
27        XMLPortObject(WagnisGameboard, WagnisProvince, "Provinces", addProvince, getProvince, xmlelement, mode);
28    }
29    //XML add province
30    //Adds a Province to the Gameboard
31    void WagnisGameboard::addProvince(WagnisProvince* province){
32        orxout() << "added" << endl;
33        orxout() << province->getID() << endl;
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    }
41}
Note: See TracBrowser for help on using the repository browser.