MapFile.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 "common/QGearsResource.h"
  17. namespace QGears {
  18. /**
  19. * Handles a world map file.
  20. */
  21. class WorldMapFile : public Resource{
  22. public:
  23. /**
  24. * The type of resource.
  25. */
  26. static const String RESOURCE_TYPE;
  27. /**
  28. * Constructor.
  29. *
  30. * @param creator[in] Pointer to the ResourceManager that is
  31. * creating this resource.
  32. * @param name[in] The unique name of the resource.
  33. * @param handle[in] @todo Understand and document.
  34. * @param group[in] The name of the resource group to which this
  35. * resource belong.
  36. * @param is_manual[in] True if the resource is manually loaded,
  37. * false otherwise.
  38. * @param loader[in] Pointer to a ManualResourceLoader
  39. * implementation which will be called when the Resource wishes to
  40. * load (should be supplied if is_manual is set to true). It can be
  41. * null, but the Resource will never be able to reload if anything
  42. * ever causes it to unload. Therefore provision of a proper
  43. * ManualResourceLoader instance is strongly recommended.
  44. */
  45. WorldMapFile(
  46. Ogre::ResourceManager* creator, const Ogre::String& name,
  47. Ogre::ResourceHandle handle, const Ogre::String& group,
  48. bool is_manual = false, Ogre::ManualResourceLoader* loader = 0
  49. );
  50. /**
  51. * Destructor.
  52. */
  53. virtual ~WorldMapFile();
  54. private:
  55. /**
  56. * Loads the map file.
  57. */
  58. virtual void loadImpl() override final;
  59. /**
  60. * Unloads the map file.
  61. */
  62. virtual void unloadImpl() override final;
  63. };
  64. typedef Ogre::SharedPtr<WorldMapFile> MapFilePtr;
  65. }