Changeset 1858 in orxonox.OLD for orxonox/trunk/core/world.cc
- Timestamp:
- May 5, 2004, 7:33:27 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/core/world.cc
r1856 r1858 24 24 25 25 26 26 /** 27 \brief Create a new World 28 29 This creates a new empty world! 30 */ 27 31 World::World () { 28 32 lastPlayer = null; 33 lastNPC = null; 29 34 } 30 35 … … 57 62 58 63 64 /** 65 \brief Remove Player 66 \param player A reference to the new npc object 67 68 Remove a new Player to the game. 69 */ 70 bool World::removePlayer(Player* player) { 71 cout << "World::removeNPC not implemented yet" << endl; 72 } 73 74 75 /** 76 \brief Add Non-Player-Character 77 \param player A reference to the new npc object 78 79 Add a new Non-Player-Character to the game. Player has to be initialised previously 80 */ 81 bool World::addNPC(NPC* npc) 82 { 83 npcList* listMember = new npcList; 84 listMember->npc = npc; 85 if ( lastNPC != null ) 86 { 87 listMember->number = lastNPC->number + 1; 88 listMember->next = lastNPC; 89 } 90 else 91 { 92 listMember->number = 0; 93 listMember->next = null; 94 } 95 lastNPC = listMember; 96 } 97 98 99 /** 100 \brief Remove Non-Player-Character 101 \param player A reference to the new npc object 102 103 Remove a new Non-Player-Character to the game. 104 */ 105 bool World::removeNPC(NPC* npc) { 106 cout << "World::removeNPC not implemented yet" << endl; 107 } 108 109 110 111 /** 112 \brief Draws the World and all Objects contained 113 114 Calls the draw function of all: Objects, Players, Environement 115 */ 116 void World::drawWorld(void) 117 { 118 playerList* tmpPlayer = lastPlayer; 119 Player* player = tmpPlayer->player; 120 while( tmpPlayer != null ) 121 { 122 (*tmpPlayer->player).drawPlayer(); 123 tmpPlayer = tmpPlayer->next; 124 } 125 npcList* tmpNPC = lastNPC; 126 while( tmpNPC != null ) 127 { 128 (*tmpNPC->npc).drawNPC(); 129 tmpNPC = tmpNPC->next; 130 } 131 } 132 133 134 /** 135 \brief Updates the world and all its objects 136 137 Calculates the new state of the world. User-input and AI of 138 the enemies are accounted for. 139 */ 140 void World::updateWorld(void) 141 { 142 143 144 } 145 146 59 147 60 148 /** … … 63 151 testing, testing, testing... 64 152 */ 65 void World::testThaTest( )153 void World::testThaTest(void) 66 154 { 67 155 cout << "World::testThaTest() called" << endl; … … 75 163 } 76 164 165 /* test addNPC */ 166 cout << "addNPC test..." << endl; 167 npcList* nl = lastNPC; 168 while ( nl != null ) 169 { 170 cout << "npc " << nl->number << " was found" << endl; 171 nl = nl->next; 172 } 173 174 /* test drawWorld() */ 175 cout << "drawWorld()..." << endl; 176 drawWorld(); 177 77 178 cout << "World::testThaTest() finished" << endl; 78 179 } 79 80 bool World::removePlayer(Player* player) {}81 82 bool World::addNPC(NPC* npc) {}83 bool World::removeNPC(NPC* npc) {}
Note: See TracChangeset
for help on using the changeset viewer.