supertux
teleporter.hpp
1 // SuperTux - Teleporter Worldmap Tile
2 // Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef HEADER_SUPERTUX_WORLDMAP_TELEPORTER_HPP
18 #define HEADER_SUPERTUX_WORLDMAP_TELEPORTER_HPP
19 
20 #include <string>
21 
22 #include "math/vector.hpp"
23 #include "sprite/sprite_ptr.hpp"
24 #include "supertux/game_object.hpp"
25 
26 class ReaderMapping;
27 
28 namespace worldmap {
29 
30 class Teleporter final : public GameObject
31 {
32 public:
33  Teleporter(const ReaderMapping& mapping);
34 
35  virtual void draw(DrawingContext& context) override;
36  virtual void update(float dt_sec) override;
37 
38  Vector get_pos() const { return m_pos; }
39  std::string get_worldmap() const { return m_worldmap; }
40  std::string get_spawnpoint() const { return m_spawnpoint; }
41  bool is_automatic() const { return m_automatic; }
42  std::string get_message() const { return m_message; }
43 
44 private:
46  Vector m_pos;
47 
49  SpritePtr m_sprite;
50 
52  std::string m_worldmap;
53 
55  std::string m_spawnpoint;
56 
58  bool m_automatic;
59 
61  std::string m_message;
62 
63 private:
64  Teleporter(const Teleporter&) = delete;
65  Teleporter& operator=(const Teleporter&) = delete;
66 };
67 
68 } // namespace worldmap
69 
70 #endif
71 
72 /* EOF */
Simple two dimensional vector.
Definition: vector.hpp:24
Definition: object_settings.hpp:28
Base class for all the things that make up Levels&#39; Sectors.
Definition: game_object.hpp:46
virtual void update(float dt_sec) override
This function is called once per frame and allows the object to update it&#39;s state.
Definition: teleporter.cpp:64
virtual void draw(DrawingContext &context) override
The GameObject should draw itself onto the provided DrawingContext if this function is called...
Definition: teleporter.cpp:56
Definition: teleporter.hpp:30
Definition: reader_mapping.hpp:31
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42