Changeset 12124 for code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.cc
- Timestamp:
- Nov 28, 2018, 11:50:16 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.cc
r12119 r12124 14 14 RegisterObject(Wagnis); 15 15 this->gameBoard = nullptr; 16 this->gameStage = NOT_READY; 17 18 int n = 3; 19 for(int i = 1;i <= n;i++){ 20 WagnisPlayer* p = new WagnisPlayer(context); 21 p->gameBoard = this->gameBoard; 22 this->players.push_back(p); 23 } 16 24 } 17 25 //Destructor … … 21 29 //Runs the game 22 30 void Wagnis::start(){ 23 31 //SUPER(Wagnis,start); 32 this->createGame(); 33 } 34 35 //Tick 36 void Wagnis::tick(float dt){ 37 SUPER(Wagnis,tick,dt); 24 38 } 25 39 26 40 //Creates and links all needed classes 27 void createGame(){ 41 void Wagnis::createGame(){\ 42 orxout() << "Game creation started"; 28 43 44 if(!findGameBoard()){ 45 orxout() << "Error: GameBoard not found"; 46 } 47 48 this->gameBoard->initializeNeighbors(); 49 orxout() << "Game creation finished"; 29 50 } 30 51 52 //Finds the pointer to the gameBoard 53 bool Wagnis::findGameBoard(){ 54 for (WagnisGameboard* gb : ObjectList<WagnisGameboard>()){ 55 this->gameBoard = gb; 56 orxout()<<"Gameboard pointer found and added"; 57 return true; 58 } 59 return false; 60 } 31 61 32 62
Note: See TracChangeset
for help on using the changeset viewer.