OpenRaider  0.1.4-dev
Open Source Tomb Raider Game Engine implementation
World.h
Go to the documentation of this file.
1 
9 #ifndef _WORLD_H_
10 #define _WORLD_H_
11 
12 #include <memory>
13 #include <vector>
14 
15 #include "Entity.h"
16 #include "Mesh.h"
17 #include "Room.h"
18 #include "SkeletalModel.h"
19 #include "Sprite.h"
20 #include "StaticMesh.h"
21 
25 class World {
26  public:
27 
31  ~World();
32 
36  void destroy();
37 
38  void addRoom(Room* room);
39  unsigned long sizeRoom();
40  Room& getRoom(unsigned long index);
41 
42  void addSprite(Sprite* sprite);
43  unsigned long sizeSprite();
44  Sprite& getSprite(unsigned long index);
45 
46  void addSpriteSequence(SpriteSequence* sprite);
47  unsigned long sizeSpriteSequence();
48  SpriteSequence& getSpriteSequence(unsigned long index);
49 
50  void addEntity(Entity* entity);
51  unsigned long sizeEntity();
52  Entity& getEntity(unsigned long index);
53 
54  void addSkeletalModel(SkeletalModel* model);
55  unsigned long sizeSkeletalModel();
56  SkeletalModel& getSkeletalModel(unsigned long index);
57 
58  void addStaticMesh(StaticMesh* model);
59  unsigned long sizeStaticMesh();
60  StaticMesh& getStaticMesh(unsigned long index);
61 
62  void addMesh(Mesh* mesh);
63  unsigned long sizeMesh();
64  Mesh& getMesh(unsigned long index);
65 
66  private:
67  std::vector<std::unique_ptr<Room>> mRooms;
68  std::vector<std::unique_ptr<Sprite>> mSprites;
69  std::vector<std::unique_ptr<SpriteSequence>> mSpriteSequences;
70  std::vector<std::unique_ptr<Entity>> mEntities;
71  std::vector<std::unique_ptr<SkeletalModel>> mModels;
72  std::vector<std::unique_ptr<StaticMesh>> mStaticMeshes;
73  std::vector<std::unique_ptr<Mesh>> mMeshes;
74 };
75 
76 World& getWorld();
77 
78 #endif
void addSkeletalModel(SkeletalModel *model)
Definition: World.cpp:77
~World()
Deconstructs an object of World.
Definition: World.cpp:11
Definition: Mesh.h:35
2D Billboard Collection
std::vector< std::unique_ptr< SpriteSequence > > mSpriteSequences
Definition: World.h:69
StaticMesh & getStaticMesh(unsigned long index)
Definition: World.cpp:98
Room & getRoom(unsigned long index)
Definition: World.cpp:33
unsigned long sizeMesh()
Definition: World.cpp:107
Static Model Meshes.
The game world (model)
Definition: World.h:25
void addRoom(Room *room)
Definition: World.cpp:25
std::vector< std::unique_ptr< Mesh > > mMeshes
Definition: World.h:73
unsigned long sizeStaticMesh()
Definition: World.cpp:94
void destroy()
Clears all data in world.
Definition: World.cpp:15
Things in the World.
World & getWorld()
Definition: main.cpp:32
unsigned long sizeEntity()
Definition: World.cpp:68
std::vector< std::unique_ptr< SkeletalModel > > mModels
Definition: World.h:71
unsigned long sizeSpriteSequence()
Definition: World.cpp:55
void addMesh(Mesh *mesh)
Definition: World.cpp:103
Entity & getEntity(unsigned long index)
Definition: World.cpp:72
std::vector< std::unique_ptr< Entity > > mEntities
Definition: World.h:70
Definition: Sprite.h:13
SpriteSequence & getSpriteSequence(unsigned long index)
Definition: World.cpp:59
Definition: Entity.h:11
std::vector< std::unique_ptr< StaticMesh > > mStaticMeshes
Definition: World.h:72
void addSprite(Sprite *sprite)
Definition: World.cpp:38
Sprite & getSprite(unsigned long index)
Definition: World.cpp:46
Moveable Mesh Geometry.
SkeletalModel & getSkeletalModel(unsigned long index)
Definition: World.cpp:85
void addSpriteSequence(SpriteSequence *sprite)
Definition: World.cpp:51
std::vector< std::unique_ptr< Sprite > > mSprites
Definition: World.h:68
unsigned long sizeSkeletalModel()
Definition: World.cpp:81
Textured/Colored Mesh.
Definition: Room.h:22
void addEntity(Entity *entity)
Definition: World.cpp:64
unsigned long sizeSprite()
Definition: World.cpp:42
unsigned long sizeRoom()
Definition: World.cpp:29
Mesh & getMesh(unsigned long index)
Definition: World.cpp:111
Room in World.
std::vector< std::unique_ptr< Room > > mRooms
Definition: World.h:67
void addStaticMesh(StaticMesh *model)
Definition: World.cpp:90