source:
orxonox.OLD/orxonox/trunk/src/world.h
@
2035
| Last change on this file since 2035 was 1956, checked in by bensch, 21 years ago | |
|---|---|
| File size: 1.2 KB | |
| Rev | Line | |
|---|---|---|
| [1853] | 1 | |
| 2 | ||
| [1872] | 3 | |
| [1853] | 4 | #ifndef WORLD_H |
| 5 | #define WORLD_H | |
| 6 | ||
| [1883] | 7 | #include <stdlib.h> |
| [1899] | 8 | #include <cmath> |
| [1883] | 9 | |
| [1872] | 10 | #include "npc.h" |
| 11 | #include "player.h" | |
| [1883] | 12 | #include "environment.h" |
| [1896] | 13 | #include "shoot_laser.h" |
| [1920] | 14 | #include "shoot_rocket.h" |
| [1872] | 15 | #include "stdincl.h" |
| [1904] | 16 | #include "data_tank.h" |
| [1853] | 17 | |
| 18 | class World { | |
| 19 | ||
| 20 | public: | |
| 21 | World (); | |
| 22 | ~World (); | |
| 23 | ||
| [1917] | 24 | float primitiveMove; |
| 25 | ||
| [1855] | 26 | /* for easier use: map the first two player here */ |
| [1872] | 27 | Player *localPlayer; |
| [1853] | 28 | Player *player1; |
| [1855] | 29 | Player *player2; |
| [1853] | 30 | |
| [1855] | 31 | /* a list of all players */ |
| 32 | struct playerList { | |
| [1856] | 33 | playerList* next; |
| [1853] | 34 | Player* player; |
| [1856] | 35 | int number; |
| [1853] | 36 | }; |
| [1855] | 37 | playerList* lastPlayer; |
| [1853] | 38 | |
| [1855] | 39 | /* a list of all non-player-characters */ |
| 40 | struct npcList { | |
| [1856] | 41 | npcList* next; |
| [1853] | 42 | NPC* npc; |
| [1858] | 43 | int number; |
| [1853] | 44 | }; |
| [1858] | 45 | npcList* lastNPC; |
| [1853] | 46 | |
| [1883] | 47 | /* a list of all environmental objects */ |
| 48 | struct envList { | |
| 49 | envList* next; | |
| 50 | Environment* env; | |
| 51 | int number; | |
| 52 | }; | |
| 53 | envList* lastEnv; | |
| 54 | ||
| [1896] | 55 | |
| 56 | ||
| [1899] | 57 | |
| [1855] | 58 | bool addPlayer(Player* player); |
| 59 | bool removePlayer(Player* player); | |
| [1872] | 60 | Player* getLocalPlayer(); |
| [1855] | 61 | bool addNPC(NPC* npc); |
| 62 | bool removeNPC(NPC* npc); | |
| [1883] | 63 | bool addEnv(Environment* env); |
| [1858] | 64 | |
| 65 | void drawWorld(void); | |
| [1883] | 66 | void initEnvironement(void); |
| [1931] | 67 | void setWorldStep(float step); |
| [1858] | 68 | void updateWorld(void); |
| [1899] | 69 | void detectCollision(void); |
| [1856] | 70 | void testThaTest(void); |
| [1855] | 71 | |
| [1883] | 72 | private: |
| 73 | float surface[120][120]; | |
| [1931] | 74 | float step; |
| [1855] | 75 | |
| [1883] | 76 | |
| [1853] | 77 | }; |
| 78 | ||
| 79 | #endif |
Note: See TracBrowser
for help on using the repository browser.










