forked from Dzejrou/tdt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathManaSpellSystem.hpp
More file actions
54 lines (47 loc) · 1.11 KB
/
ManaSpellSystem.hpp
File metadata and controls
54 lines (47 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once
#include <Ogre.h>
#include "System.hpp"
#include "EntitySystem.hpp"
/**
* Regenerates mana to the player and all entities that have mana. Also
* takes care of entity spell casting.
*/
class ManaSpellSystem : public System
{
public:
/**
* Constructor.
* Param: Entity system containing entities this system works with.
*/
ManaSpellSystem(EntitySystem&);
/**
* Destructor.
*/
~ManaSpellSystem() = default;
/**
* Brief: Regenerates mana if necessary and performs entity spell
* casting if off cooldown.
* Param: Time since last frame.
*/
void update(Ogre::Real) override;
/**
* Brief: Sets the time period between mana regens.
* Param: The new time period.
*/
void set_regen_period(Ogre::Real);
/**
* Brief: Returns the time period between mana regens.
*/
Ogre::Real get_regen_period() const;
private:
/**
* Entity system containing entities that this system
* works with.
*/
EntitySystem& entities_;
/**
* Allow for dynamic periods between mana regeneration
* updates.
*/
Ogre::Real regen_timer_, regen_period_;
};