Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/world.h @ 2080

Last change on this file since 2080 was 2077, checked in by patrick, 20 years ago

/orxonox/trunk/src: making doxygen comments in worldentity, player, world; extending API of worldentity; inserting list.h in world - this version does not compile

File size: 2.3 KB
RevLine 
[2077]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*/
[1853]6
7#ifndef WORLD_H
8#define WORLD_H
9
[2036]10class Player;
11class NPC;
12class Environment;
[2077]13class WorldEntity;
[1883]14
[2077]15template<class T> class List;
[1853]16
[2077]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*/
[1853]25class World {
26
27 public:
28  World ();
29  ~World ();
30
[1917]31
[1853]32
[2077]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  /*
[1855]40  struct playerList {
[1856]41    playerList* next;
[1853]42    Player* player;
[1856]43    int number;
[1853]44  };
[1855]45  playerList* lastPlayer;
[1853]46
[1855]47  struct npcList {
[1856]48    npcList* next;
[1853]49    NPC* npc;
[1858]50    int number;
[1853]51  };
[1858]52  npcList* lastNPC;
[1853]53
[1883]54  struct envList {
55    envList* next;
56    Environment* env;
57    int number;
58  };
59  envList* lastEnv;
[2077]60  */
[1883]61
[1896]62
[2077]63  void loadWorld();
64  void unloadWorld();
65  void pauseWorld();
66  void saveGameState(char* filename);
67 
[1896]68
[1855]69  bool addPlayer(Player* player);
70  bool removePlayer(Player* player);
[1872]71  Player* getLocalPlayer();
[1855]72  bool addNPC(NPC* npc);
73  bool removeNPC(NPC* npc);
[1883]74  bool addEnv(Environment* env);
[2077]75  bool removeEnv(Environment* env);
[1858]76
[2077]77 
[1858]78  void drawWorld(void);
[1883]79  void initEnvironement(void);
[1931]80  void setWorldStep(float step);
[1858]81  void updateWorld(void);
[1899]82  void detectCollision(void);
[1856]83  void testThaTest(void);
[1855]84
[1883]85 private:
[2077]86  float surface[120][120]; //!< deprecated: used to build a surface
87  float step; //!< this is the step
[1855]88
[2077]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
[1883]92
[2077]93
[1853]94};
95
96#endif
Note: See TracBrowser for help on using the repository browser.