WorldMapManager.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. * Copyright (C) 2022 The V-Gears Team
  3. *
  4. * This file is part of V-Gears
  5. *
  6. * V-Gears is free software: you can redistribute it and/or modify it under
  7. * terms of the GNU General Public License as published by the Free Software
  8. * Foundation, version 3.0 (GPLv3) of the License.
  9. *
  10. * V-Gears is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #pragma once
  16. #include <OgreSingleton.h>
  17. #include "Event.h"
  18. #include "Manager.h"
  19. /**
  20. * The world map manager.
  21. */
  22. class WorldMapManager : public Manager, public Ogre::Singleton<WorldMapManager>{
  23. public:
  24. /**
  25. * Constructor.
  26. */
  27. WorldMapManager();
  28. /**
  29. * Destructor.
  30. */
  31. virtual ~WorldMapManager();
  32. /**
  33. * Handles an input event.
  34. *
  35. * @param[in] event Event to handle.
  36. */
  37. void Input(const VGears::Event& event) override;
  38. /**
  39. * Updates the world map manager with debug information.
  40. *
  41. * It's automatically called from {@see Update}.
  42. */
  43. void UpdateDebug() override;
  44. /**
  45. * Handles resizing events
  46. */
  47. void OnResize() override;
  48. /**
  49. * Clears all field information in the field manager.
  50. *
  51. * Does nothing.
  52. */
  53. void ClearField() override;
  54. /**
  55. * Clears all battle information in the battle manager.
  56. *
  57. * Does nothing
  58. */
  59. void ClearBattle() override;
  60. /**
  61. * Clears all world map information in the world map manager.
  62. */
  63. void ClearWorld() override;
  64. /**
  65. * Adds a terrain block.
  66. *
  67. * @param[in] index Block index.
  68. * @param[in] mesh Path to the mesh file.
  69. * @param[in] pos Terrain position (x, y, z).
  70. */
  71. void AddTerrain(
  72. const unsigned int id, const Ogre::String mesh, const Ogre::Vector3 pos
  73. );
  74. private:
  75. /**
  76. * Updates the manager while in the field.
  77. *
  78. * It does nothing
  79. */
  80. void UpdateField() override;
  81. /**
  82. * Updates the manager during a battle.
  83. */
  84. void UpdateBattle() override;
  85. /**
  86. * Updates manager while in the world map.
  87. *
  88. * It does nothing
  89. */
  90. void UpdateWorld() override;
  91. /**
  92. * The scene node.
  93. */
  94. Ogre::SceneNode* scene_node_;
  95. };