supertux
teleporter.hpp
1 // SuperTux - Teleporter Worldmap Tile
2 // Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
3 // 2023 Vankata453
4 //
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program 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 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 #ifndef HEADER_SUPERTUX_WORLDMAP_TELEPORTER_HPP
19 #define HEADER_SUPERTUX_WORLDMAP_TELEPORTER_HPP
20 
21 #include "worldmap/worldmap_object.hpp"
22 
23 #include <string>
24 
25 namespace worldmap {
26 
27 class Teleporter final : public WorldMapObject
28 {
29 public:
30  Teleporter(const ReaderMapping& mapping);
31 
32  static std::string class_name() { return "teleporter"; }
33  virtual std::string get_class_name() const override { return class_name(); }
34  static std::string display_name() { return _("Teleporter"); }
35  virtual std::string get_display_name() const override { return display_name(); }
36  virtual GameObjectClasses get_class_types() const override { return WorldMapObject::get_class_types().add(typeid(Teleporter)); }
37 
38  virtual ObjectSettings get_settings() override;
39 
40  const std::string& get_worldmap() const { return m_worldmap; }
41  const std::string& get_sector() const { return m_sector; }
42  const std::string& get_spawnpoint() const { return m_spawnpoint; }
43  bool is_automatic() const { return m_automatic; }
44  const std::string& get_message() const { return m_message; }
45 
46 private:
48  std::string m_worldmap;
49 
51  std::string m_sector;
52 
54  std::string m_spawnpoint;
55 
57  bool m_automatic;
58 
60  std::string m_message;
61 
62 private:
63  Teleporter(const Teleporter&) = delete;
64  Teleporter& operator=(const Teleporter&) = delete;
65 };
66 
67 } // namespace worldmap
68 
69 #endif
70 
71 /* EOF */
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user&#39;s locale.
Definition: teleporter.hpp:35
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: teleporter.hpp:36
Definition: worldmap_object.hpp:30
Definition: object_settings.hpp:39
Definition: object_settings.hpp:32
Definition: teleporter.hpp:27
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: worldmap_object.hpp:39
Definition: reader_mapping.hpp:32