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 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 <list>
  11. #include <vector>
  12. #include "Entity.h"
  13. #include "Room.h"
  14. #include "SkeletalModel.h"
  15. #include "Sprite.h"
  16. #include "StaticMesh.h"
  17. /*!
  18. * \brief The game world (model)
  19. */
  20. class World {
  21. public:
  22. /*!
  23. * \brief Deconstructs an object of World
  24. */
  25. ~World();
  26. /*!
  27. * \brief Clears all data in world
  28. */
  29. void destroy();
  30. void addRoom(Room &room);
  31. unsigned int sizeRoom();
  32. Room &getRoom(unsigned int index);
  33. void addSprite(SpriteSequence &sprite);
  34. unsigned int sizeSprite();
  35. SpriteSequence &getSprite(unsigned int index);
  36. void addEntity(Entity &entity);
  37. unsigned int sizeEntity();
  38. Entity &getEntity(unsigned int index);
  39. void addSkeletalModel(SkeletalModel &model);
  40. unsigned int sizeSkeletalModel();
  41. SkeletalModel &getSkeletalModel(unsigned int index);
  42. void addStaticMesh(StaticMesh &model);
  43. unsigned int sizeStaticMesh();
  44. StaticMesh &getStaticMesh(unsigned int index);
  45. /*!
  46. * \brief Find room a location is in.
  47. *
  48. * If it fails to be in a room it gives closest overlapping room.
  49. * \param index Guessed room index
  50. * \param x X coordinate
  51. * \param y Y coordinate
  52. * \param z Z coordinate
  53. * \returns correct room index or -1 for unknown
  54. */
  55. int getRoomByLocation(int index, float x, float y, float z);
  56. /*!
  57. * \brief Find room a location is in.
  58. *
  59. * If it fails to be in a room it gives closest overlapping room.
  60. * \param x X coordinate
  61. * \param y Y coordinate
  62. * \param z Z coordinate
  63. * \returns correct room index or -1 for unknown
  64. */
  65. int getRoomByLocation(float x, float y, float z);
  66. private:
  67. std::vector<Room *> mRooms;
  68. std::vector<SpriteSequence *> mSprites;
  69. std::vector<Entity *> mEntities;
  70. std::vector<SkeletalModel *> mModels;
  71. std::vector<StaticMesh *> mMeshes;
  72. };
  73. World &getWorld();
  74. #endif