Open Source Tomb Raider Engine
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

World.h 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*!
  2. * \file include/World.h
  3. * \brief The game 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. /*!
  24. * \brief Deconstructs an object of World
  25. */
  26. ~World();
  27. /*!
  28. * \brief Clears all data in world
  29. */
  30. void destroy();
  31. void addRoom(Room* room);
  32. unsigned long sizeRoom();
  33. Room& getRoom(unsigned long index);
  34. void addSprite(SpriteSequence* sprite);
  35. unsigned long sizeSprite();
  36. SpriteSequence& getSprite(unsigned long index);
  37. void addEntity(Entity* entity);
  38. unsigned long sizeEntity();
  39. Entity& getEntity(unsigned long index);
  40. void addSkeletalModel(SkeletalModel* model);
  41. unsigned long sizeSkeletalModel();
  42. SkeletalModel& getSkeletalModel(unsigned long index);
  43. void addStaticMesh(StaticMesh* model);
  44. unsigned long sizeStaticMesh();
  45. StaticMesh& getStaticMesh(unsigned long index);
  46. void addMesh(Mesh* mesh);
  47. unsigned long sizeMesh();
  48. Mesh& getMesh(unsigned long index);
  49. private:
  50. std::vector<std::unique_ptr<Room>> mRooms;
  51. std::vector<std::unique_ptr<SpriteSequence>> mSprites;
  52. std::vector<std::unique_ptr<Entity>> mEntities;
  53. std::vector<std::unique_ptr<SkeletalModel>> mModels;
  54. std::vector<std::unique_ptr<StaticMesh>> mStaticMeshes;
  55. std::vector<std::unique_ptr<Mesh>> mMeshes;
  56. };
  57. World& getWorld();
  58. #endif