Otclient  14/8/2020
particlesystem.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2020 OTClient <https://github.com/edubart/otclient>
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20  * THE SOFTWARE.
21  */
22 
23 #ifndef PARTICLESYSTEM_H
24 #define PARTICLESYSTEM_H
25 
26 #include "declarations.h"
27 #include "particle.h"
28 #include "particleemitter.h"
29 #include "particleaffector.h"
30 
32 public:
34 
35  void load(const OTMLNodePtr& node);
36 
37  void addParticle(const ParticlePtr& particle);
38 
39  void render();
40  void update();
41 
42  bool hasFinished() { return m_finished; }
43 
44 private:
45  bool m_finished;
46  float m_lastUpdateTime;
47  std::list<ParticlePtr> m_particles;
48  std::list<ParticleEmitterPtr> m_emitters;
49  std::list<ParticleAffectorPtr> m_affectors;
50 };
51 
52 #endif
ParticleSystem::render
void render()
Definition: particlesystem.cpp:62
particleemitter.h
particleaffector.h
ParticleSystem::load
void load(const OTMLNodePtr &node)
Definition: particlesystem.cpp:33
ParticleSystem::ParticleSystem
ParticleSystem()
Definition: particlesystem.cpp:27
ParticleSystem::update
void update()
Definition: particlesystem.cpp:69
ParticleSystem::hasFinished
bool hasFinished()
Definition: particlesystem.h:42
particle.h
declarations.h
stdext::shared_object_ptr< OTMLNode >
ParticleSystem
Definition: particlesystem.h:31
ParticleSystem::addParticle
void addParticle(const ParticlePtr &particle)
Definition: particlesystem.cpp:57
stdext::shared_object
Definition: shared_object.h:41