/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2004 orx This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ### File Specific: main-programmer: Patrick Boenzli co-programmer: */ #include "world.h" #include using namespace std; World::World () { lastPlayer = null; } World::~World () {} /** \brief Add Player \param player A reference to the new player object Add a new Player to the game. Player has to be initialised previously */ bool World::addPlayer(Player* player) { playerList* listMember = new playerList; listMember->player = player; if ( lastPlayer != null ) { listMember->number = lastPlayer->number + 1; listMember->next = lastPlayer; } else { listMember->number = 0; listMember->next = null; } lastPlayer = listMember; } /** \brief Routine for testing purposes. testing, testing, testing... */ void World::testThaTest() { cout << "World::testThaTest() called" << endl; /* test addPlayer */ cout << "addPlayer test..." << endl; playerList* pl = lastPlayer; while ( pl != null ) { cout << "player " << pl->number << " was found" << endl; pl = pl->next; } cout << "World::testThaTest() finished" << endl; } bool World::removePlayer(Player* player) {} bool World::addNPC(NPC* npc) {} bool World::removeNPC(NPC* npc) {}