supertux
special_tile.hpp
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 
19 #ifndef HEADER_SUPERTUX_WORLDMAP_SPECIAL_TILE_HPP
20 #define HEADER_SUPERTUX_WORLDMAP_SPECIAL_TILE_HPP
21 
22 #include "worldmap/worldmap_object.hpp"
23 
24 #include <string>
25 
26 namespace worldmap {
27 
28 class SpecialTile final : public WorldMapObject
29 {
30 public:
31  SpecialTile(const ReaderMapping& mapping);
32  ~SpecialTile() override;
33 
34  static std::string class_name() { return "special-tile"; }
35  virtual std::string get_class_name() const override { return class_name(); }
36  static std::string display_name() { return _("Special Tile"); }
37  virtual std::string get_display_name() const override { return display_name(); }
38  virtual GameObjectClasses get_class_types() const override { return WorldMapObject::get_class_types().add(typeid(SpecialTile)); }
39 
40  virtual void draw_worldmap(DrawingContext& context) override;
41 
42  virtual ObjectSettings get_settings() override;
43 
44  const std::string& get_map_message() const { return m_map_message; }
45  bool is_passive_message() const { return m_passive_message; }
46  const std::string& get_script() const { return m_script; }
47 
48  bool get_apply_action_north() const { return m_apply_action_north; }
49  bool get_apply_action_east() const { return m_apply_action_east; }
50  bool get_apply_action_south() const { return m_apply_action_south; }
51  bool get_apply_action_west() const { return m_apply_action_west; }
52 
53 private:
55  std::string m_map_message;
56  bool m_passive_message;
57 
59  std::string m_script;
60 
62  bool m_invisible;
63 
65  std::string m_apply_direction;
66  bool m_apply_action_north;
67  bool m_apply_action_east;
68  bool m_apply_action_south;
69  bool m_apply_action_west;
70 
71 private:
72  SpecialTile(const SpecialTile&) = delete;
73  SpecialTile& operator=(const SpecialTile&) = delete;
74 };
75 
76 } // namespace worldmap
77 
78 #endif
79 
80 /* EOF */
Definition: worldmap_object.hpp:30
Definition: object_settings.hpp:39
virtual void draw_worldmap(DrawingContext &context) override
Draws the object, when on a worldmap.
Definition: special_tile.cpp:61
Definition: object_settings.hpp:32
Definition: special_tile.hpp:28
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user&#39;s locale.
Definition: special_tile.hpp:37
A helper structure to list all the type_indexes of the classes in the type hierarchy of a given class...
Definition: game_object.hpp:57
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: special_tile.hpp:38
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: worldmap_object.hpp:39
Definition: reader_mapping.hpp:32
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42