Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2068 in orxonox.OLD for orxonox/branches/chris/src/world.h


Ignore:
Timestamp:
Jul 5, 2004, 10:43:49 AM (21 years ago)
Author:
chris
Message:

orxonox/branches/chris: First snippet of the totally revamped base system… perhaps a bit confusing at the moment, but when finished theoretically you only have to subclass the worldentity and track classes to create the game content (even the menu will be a WorldEntity I suppose)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/chris/src/world.h

    r2058 r2068  
    22#ifndef WORLD_H
    33#define WORLD_H
    4 
    5 class Player;
    6 class NPC;
    7 class Environment;
    8 
    94
    105class World {
     
    149  ~World ();
    1510
    16   float primitiveMove;
     11        template<class T> T* spawn<T>(Location* loc, WorldEntity* owner);       // template to be able to spawn any derivation of WorldEntity
    1712
    18   /* for easier use: map the first two player here */
    19   Player *localPlayer;
    20   Player *player1;
    21   Player *player2;
    22 
    23   /* a list of all players */
    24   struct playerList {
    25     playerList* next;
    26     Player* player;
    27     int number;
    28   };
    29   playerList* lastPlayer;
    30 
    31   /* a list of all non-player-characters */
    32   struct npcList {
    33     npcList* next;
    34     NPC* npc;
    35     int number;
    36   };
    37   npcList* lastNPC;
    38 
    39   /* a list of all environmental objects */
    40   struct envList {
    41     envList* next;
    42     Environment* env;
    43     int number;
    44   };
    45   envList* lastEnv;
    46 
    47 
    48 
    49 
    50   bool addPlayer(Player* player);
    51   bool removePlayer(Player* player);
    52   Player* getLocalPlayer();
    53   bool addNPC(NPC* npc);
    54   bool removeNPC(NPC* npc);
    55   bool addEnv(Environment* env);
    56 
    57   void drawWorld(void);
    58   void initEnvironement(void);
    59   void setWorldStep(float step);
    60   void updateWorld(void);
    61   void detectCollision(void);
    62   void testThaTest(void);
    63 
     13        void time_slice (Uint32 deltaT);
     14        void collide ();
     15        void draw ();
     16        void update (); // maps Locations to Placements
     17        void calc_camera_pos (Location* loc, Placement* plc);
     18       
    6419 private:
    65   float surface[120][120];
    66   float step;
    67 
     20 
     21        List<WorldEntity>* entities;
     22       
     23                // base level data
     24        Track* track;
     25        Uint32 tracklen;
     26        Vector* pathnodes;
    6827
    6928};
Note: See TracChangeset for help on using the changeset viewer.