special_tile.hpp 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // SuperTux
  2. // Copyright (C) 2004 Ingo Ruhnke <grumbel@gmail.com>
  3. // Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
  4. // 2023 Vankata453
  5. //
  6. // This program is free software: you can redistribute it and/or modify
  7. // it under the terms of the GNU General Public License as published by
  8. // the Free Software Foundation, either version 3 of the License, or
  9. // (at your option) any later version.
  10. //
  11. // This program is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. // GNU General Public License for more details.
  15. //
  16. // You should have received a copy of the GNU General Public License
  17. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. #ifndef HEADER_SUPERTUX_WORLDMAP_SPECIAL_TILE_HPP
  19. #define HEADER_SUPERTUX_WORLDMAP_SPECIAL_TILE_HPP
  20. #include "worldmap/worldmap_object.hpp"
  21. #include <string>
  22. namespace worldmap {
  23. class SpecialTile final : public WorldMapObject
  24. {
  25. public:
  26. SpecialTile(const ReaderMapping& mapping);
  27. ~SpecialTile() override;
  28. static std::string class_name() { return "special-tile"; }
  29. virtual std::string get_class_name() const override { return class_name(); }
  30. static std::string display_name() { return _("Special Tile"); }
  31. virtual std::string get_display_name() const override { return display_name(); }
  32. virtual void draw_worldmap(DrawingContext& context) override;
  33. virtual ObjectSettings get_settings() override;
  34. std::string get_map_message() const { return m_map_message; }
  35. bool is_passive_message() const { return m_passive_message; }
  36. std::string get_script() const { return m_script; }
  37. bool get_apply_action_north() const { return m_apply_action_north; }
  38. bool get_apply_action_east() const { return m_apply_action_east; }
  39. bool get_apply_action_south() const { return m_apply_action_south; }
  40. bool get_apply_action_west() const { return m_apply_action_west; }
  41. private:
  42. /** Message to show in the Map */
  43. std::string m_map_message;
  44. bool m_passive_message;
  45. /** Script to execute when tile is touched */
  46. std::string m_script;
  47. /** Hide special tile */
  48. bool m_invisible;
  49. /** Only applies actions (ie. passive messages) when going to that direction */
  50. std::string m_apply_direction;
  51. bool m_apply_action_north;
  52. bool m_apply_action_east;
  53. bool m_apply_action_south;
  54. bool m_apply_action_west;
  55. private:
  56. SpecialTile(const SpecialTile&) = delete;
  57. SpecialTile& operator=(const SpecialTile&) = delete;
  58. };
  59. } // namespace worldmap
  60. #endif
  61. /* EOF */