ManaPlus
effectmanager.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2008 Fate <[email protected]>
4  * Copyright (C) 2008 Chuck Miller <[email protected]>
5  * Copyright (C) 2011-2019 The ManaPlus Developers
6  * Copyright (C) 2019-2021 Andrei Karas
7  *
8  * This file is part of The ManaPlus Client.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef EFFECTMANAGER_H
25 #define EFFECTMANAGER_H
26 
28 
30 
31 #include "utils/vector.h"
32 
33 #include "particle/particletimer.h"
34 
36 
37 #include <list>
38 
39 #include "localconsts.h"
40 
41 class Being;
42 class Particle;
43 
45 {
46  public:
47  EffectManager();
48 
50 
52 
53  void loadXmlFile(const std::string &fileName,
54  const SkipError skipError);
55 
60  bool trigger(const int id,
61  Being *const being,
62  const int rotation);
63 
64  bool triggerDirection(const int id,
65  Being *const being,
66  const SpriteDirection::Type &direction);
67 
68  Particle *triggerReturn(const int id,
69  Being *const being,
70  const int rotation);
71 
76  bool trigger(const int id,
77  const int x, const int y,
78  const time_t endTime,
79  const int rotation);
80 
81  void triggerDefault(int effectId,
82  Being *const being,
83  const int defaultEffectId);
84 
85  void triggerDefault(int effectId,
86  const int x,
87  const int y,
88  const time_t endTime,
89  const int defaultEffectId);
90 
91  void logic();
92 
93  void clear();
94 
95  private:
96  STD_VECTOR<EffectDescription> mEffects;
97  std::list<ParticleTimer> mTimers;
98 };
99 
101 
102 #endif // EFFECTMANAGER_H
Definition: being.h:96
Particle * triggerReturn(const int id, Being *const being, const int rotation)
std::list< ParticleTimer > mTimers
Definition: effectmanager.h:97
void loadXmlFile(const std::string &fileName, const SkipError skipError)
bool triggerDirection(const int id, Being *const being, const SpriteDirection::Type &direction)
bool trigger(const int id, Being *const being, const int rotation)
void triggerDefault(int effectId, Being *const being, const int defaultEffectId)
std::vector< EffectDescription > mEffects
Definition: effectmanager.h:96
EffectManager * effectManager
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53
bool SkipError
Definition: skiperror.h:30
std::string fileName
Definition: testmain.cpp:39