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 //
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_SPECIAL_TILE_HPP
19 #define HEADER_SUPERTUX_WORLDMAP_SPECIAL_TILE_HPP
20 
21 #include <string>
22 
23 #include "math/vector.hpp"
24 #include "sprite/sprite_ptr.hpp"
25 #include "supertux/game_object.hpp"
26 
27 class ReaderMapping;
28 
29 namespace worldmap {
30 
31 class SpecialTile final : public GameObject
32 {
33 public:
34  SpecialTile(const ReaderMapping& mapping);
35  virtual ~SpecialTile();
36 
37  virtual void draw(DrawingContext& context) override;
38  virtual void update(float dt_sec) override;
39 
40  Vector get_pos() const { return m_pos; }
41  std::string get_map_message() const { return m_map_message; }
42  bool is_passive_message() const { return m_passive_message; }
43  std::string get_script() const { return m_script; }
44 
45  bool get_apply_action_north() const { return m_apply_action_north; }
46  bool get_apply_action_east() const { return m_apply_action_east; }
47  bool get_apply_action_south() const { return m_apply_action_south; }
48  bool get_apply_action_west() const { return m_apply_action_west; }
49 
50 private:
51  Vector m_pos;
52 
54  SpritePtr m_sprite;
55 
57  std::string m_map_message;
58  bool m_passive_message;
59 
61  std::string m_script;
62 
64  bool m_invisible;
65 
67  bool m_apply_action_north;
68  bool m_apply_action_east;
69  bool m_apply_action_south;
70  bool m_apply_action_west;
71 
72 private:
73  SpecialTile(const SpecialTile&) = delete;
74  SpecialTile& operator=(const SpecialTile&) = delete;
75 };
76 
77 } // namespace worldmap
78 
79 #endif
80 
81 /* EOF */
Simple two dimensional vector.
Definition: vector.hpp:24
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: special_tile.cpp:101
virtual void draw(DrawingContext &context) override
The GameObject should draw itself onto the provided DrawingContext if this function is called...
Definition: special_tile.cpp:92
Definition: object_settings.hpp:28
Base class for all the things that make up Levels&#39; Sectors.
Definition: game_object.hpp:46
Definition: special_tile.hpp:31
Definition: reader_mapping.hpp:31
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42