Open Source Tomb Raider Engine
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

World.h 2.0KB

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