supertux
ghost_particle_system.hpp
1 // SuperTux
2 // Copyright (C) 2009 Ingo Ruhnke <grumbel@gmail.com>
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_OBJECT_GHOST_PARTICLE_SYSTEM_HPP
18 #define HEADER_SUPERTUX_OBJECT_GHOST_PARTICLE_SYSTEM_HPP
19 
20 #include "object/particlesystem.hpp"
21 #include "video/surface_ptr.hpp"
22 
23 class ReaderMapping;
24 
25 class GhostParticleSystem final : public ParticleSystem
26 {
27 public:
29  GhostParticleSystem(const ReaderMapping& reader);
30  ~GhostParticleSystem() override;
31 
32  void init();
33  virtual void update(float dt_sec) override;
34 
35  static std::string class_name() { return "particles-ghosts"; }
36  virtual std::string get_class_name() const override { return class_name(); }
37  static std::string display_name() { return _("Ghost Particles"); }
38  virtual std::string get_display_name() const override { return display_name(); }
39  virtual GameObjectClasses get_class_types() const override { return ParticleSystem::get_class_types().add(typeid(GhostParticleSystem)); }
40 
41  virtual const std::string get_icon_path() const override {
42  return "images/engine/editor/ghostparticles.png";
43  }
44 
45 private:
46  class GhostParticle : public Particle
47  {
48  public:
49  float speed;
50 
51  GhostParticle() :
52  speed()
53  {}
54  };
55 
56  SurfacePtr ghosts[2];
57 
58 private:
60  GhostParticleSystem& operator=(const GhostParticleSystem&) = delete;
61 };
62 
63 #endif
64 
65 /* EOF */
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: ghost_particle_system.cpp:68
Definition: ghost_particle_system.hpp:25
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user&#39;s locale.
Definition: ghost_particle_system.hpp:38
Definition: particlesystem.hpp:86
This is the base class for particle systems.
Definition: particlesystem.hpp:49
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: ghost_particle_system.hpp:39
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: particlesystem.hpp:66
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
Definition: reader_mapping.hpp:32