Otclient  14/8/2020
particlemanager.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 PARTICLEMANAGER_H
24 #define PARTICLEMANAGER_H
25 
26 #include "declarations.h"
27 #include "particleeffect.h"
28 #include "particletype.h"
29 
31 {
32 public:
33  bool importParticle(std::string file);
34  ParticleEffectPtr createEffect(const std::string& name);
35  void terminate();
36 
37  void poll();
38 
39  ParticleTypePtr getParticleType(std::string name) { return m_particleTypes[name]; }
40  ParticleEffectTypePtr getParticleEffectType(std::string name) { return m_effectsTypes[name]; }
41 
42  const std::map<std::string, ParticleTypePtr>& getParticleTypes() { return m_particleTypes; }
43  const std::map<std::string, ParticleEffectTypePtr>& getEffectsTypes() { return m_effectsTypes; }
44 
45 private:
46  std::list<ParticleEffectPtr> m_effects;
47  std::map<std::string, ParticleEffectTypePtr> m_effectsTypes;
48  std::map<std::string, ParticleTypePtr> m_particleTypes;
49 };
50 
52 
53 #endif
ParticleManager::createEffect
ParticleEffectPtr createEffect(const std::string &name)
Definition: particlemanager.cpp:54
ParticleManager::getParticleEffectType
ParticleEffectTypePtr getParticleEffectType(std::string name)
Definition: particlemanager.h:40
g_particles
ParticleManager g_particles
Definition: particlemanager.cpp:27
ParticleManager::importParticle
bool importParticle(std::string file)
Definition: particlemanager.cpp:29
ParticleManager::getParticleType
ParticleTypePtr getParticleType(std::string name)
Definition: particlemanager.h:39
ParticleManager::getParticleTypes
const std::map< std::string, ParticleTypePtr > & getParticleTypes()
Definition: particlemanager.h:42
particleeffect.h
particletype.h
ParticleManager::getEffectsTypes
const std::map< std::string, ParticleEffectTypePtr > & getEffectsTypes()
Definition: particlemanager.h:43
ParticleManager::poll
void poll()
Definition: particlemanager.cpp:74
declarations.h
stdext::shared_object_ptr
Definition: shared_object.h:39
ParticleManager::terminate
void terminate()
Definition: particlemanager.cpp:67
ParticleManager
Definition: particlemanager.h:30