| 1 | /** |
|---|
| 2 | Class representating the game-world |
|---|
| 3 | |
|---|
| 4 | It contains a list of players (if multiplayer game), a list of Non-Player-Characters (nps), a list of Environment Entities. All this things together are building the orxonox-world. This class also handels the story-line (track), the world start/stop, init/uninit abilities. It is the middle point of every orxonox world. |
|---|
| 5 | */ |
|---|
| 6 | |
|---|
| 7 | #ifndef WORLD_H |
|---|
| 8 | #define WORLD_H |
|---|
| 9 | |
|---|
| 10 | class Player; |
|---|
| 11 | class NPC; |
|---|
| 12 | class Environment; |
|---|
| 13 | class WorldEntity; |
|---|
| 14 | |
|---|
| 15 | template<class T> class List; |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | //! World Class |
|---|
| 20 | /** |
|---|
| 21 | Class for World representation |
|---|
| 22 | |
|---|
| 23 | It contains a list of players (if multiplayer game), a list of Non-Player-Characters (nps), a list of Environment Entities. All this things together are building the orxonox-world. This class also handels the story-line (track), the world start/stop, init/uninit abilities. It is the middle point of every orxonox world. |
|---|
| 24 | */ |
|---|
| 25 | class World { |
|---|
| 26 | |
|---|
| 27 | public: |
|---|
| 28 | World (); |
|---|
| 29 | ~World (); |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | float primitiveMove; //!< deprecated, do not use |
|---|
| 34 | |
|---|
| 35 | Player *localPlayer; //!< a pointer to the local player object |
|---|
| 36 | Player *player1; //!< a pointer to the second player object |
|---|
| 37 | Player *player2; //!< a pointer to the third player object |
|---|
| 38 | |
|---|
| 39 | /* |
|---|
| 40 | struct playerList { |
|---|
| 41 | playerList* next; |
|---|
| 42 | Player* player; |
|---|
| 43 | int number; |
|---|
| 44 | }; |
|---|
| 45 | playerList* lastPlayer; |
|---|
| 46 | |
|---|
| 47 | struct npcList { |
|---|
| 48 | npcList* next; |
|---|
| 49 | NPC* npc; |
|---|
| 50 | int number; |
|---|
| 51 | }; |
|---|
| 52 | npcList* lastNPC; |
|---|
| 53 | |
|---|
| 54 | struct envList { |
|---|
| 55 | envList* next; |
|---|
| 56 | Environment* env; |
|---|
| 57 | int number; |
|---|
| 58 | }; |
|---|
| 59 | envList* lastEnv; |
|---|
| 60 | */ |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | void loadWorld(); |
|---|
| 64 | void unloadWorld(); |
|---|
| 65 | void pauseWorld(); |
|---|
| 66 | void saveGameState(char* filename); |
|---|
| 67 | |
|---|
| 68 | |
|---|
| 69 | bool addPlayer(Player* player); |
|---|
| 70 | bool removePlayer(Player* player); |
|---|
| 71 | Player* getLocalPlayer(); |
|---|
| 72 | bool addNPC(NPC* npc); |
|---|
| 73 | bool removeNPC(NPC* npc); |
|---|
| 74 | bool addEnv(Environment* env); |
|---|
| 75 | bool removeEnv(Environment* env); |
|---|
| 76 | |
|---|
| 77 | |
|---|
| 78 | void drawWorld(void); |
|---|
| 79 | void initEnvironement(void); |
|---|
| 80 | void setWorldStep(float step); |
|---|
| 81 | void updateWorld(void); |
|---|
| 82 | void detectCollision(void); |
|---|
| 83 | void testThaTest(void); |
|---|
| 84 | |
|---|
| 85 | private: |
|---|
| 86 | float surface[120][120]; //!< deprecated: used to build a surface |
|---|
| 87 | float step; //!< this is the step |
|---|
| 88 | |
|---|
| 89 | List<WorldEntity*> *playerList; //!< the list of players, usualy very short |
|---|
| 90 | List<WorldEntity*> *npcList; //!< list of non player characters (npc) |
|---|
| 91 | List<WorldEntity*> *envList; //!< list of environment objects |
|---|
| 92 | |
|---|
| 93 | |
|---|
| 94 | }; |
|---|
| 95 | |
|---|
| 96 | #endif |
|---|