Open Source Tomb Raider Engine
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

World.h 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*!
  2. * \file include/World.h
  3. * \brief World Model
  4. *
  5. * \author Mongoose
  6. * \author xythobuz
  7. */
  8. #ifndef _WORLD_H_
  9. #define _WORLD_H_
  10. #include <memory>
  11. #include <vector>
  12. #include "Entity.h"
  13. #include "Mesh.h"
  14. #include "Room.h"
  15. #include "SkeletalModel.h"
  16. #include "Sprite.h"
  17. #include "StaticMesh.h"
  18. /*!
  19. * \brief The game world (model)
  20. */
  21. class World {
  22. public:
  23. static void destroy();
  24. static void addRoom(Room* room);
  25. static unsigned long sizeRoom();
  26. static Room& getRoom(unsigned long index);
  27. static void addSprite(Sprite* sprite);
  28. static unsigned long sizeSprite();
  29. static Sprite& getSprite(unsigned long index);
  30. static void addSpriteSequence(SpriteSequence* sprite);
  31. static unsigned long sizeSpriteSequence();
  32. static SpriteSequence& getSpriteSequence(unsigned long index);
  33. static void addEntity(Entity* entity);
  34. static unsigned long sizeEntity();
  35. static Entity& getEntity(unsigned long index);
  36. static void addSkeletalModel(SkeletalModel* model);
  37. static unsigned long sizeSkeletalModel();
  38. static SkeletalModel& getSkeletalModel(unsigned long index);
  39. static void addStaticMesh(StaticMesh* model);
  40. static unsigned long sizeStaticMesh();
  41. static StaticMesh& getStaticMesh(unsigned long index);
  42. static void addMesh(Mesh* mesh);
  43. static unsigned long sizeMesh();
  44. static Mesh& getMesh(unsigned long index);
  45. static void displayUI();
  46. private:
  47. static std::vector<std::unique_ptr<Room>> rooms;
  48. static std::vector<std::unique_ptr<Sprite>> sprites;
  49. static std::vector<std::unique_ptr<SpriteSequence>> spriteSequences;
  50. static std::vector<std::unique_ptr<Entity>> entities;
  51. static std::vector<std::unique_ptr<SkeletalModel>> models;
  52. static std::vector<std::unique_ptr<StaticMesh>> staticMeshes;
  53. static std::vector<std::unique_ptr<Mesh>> meshes;
  54. };
  55. #endif