forked from Dzejrou/tdt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExplosionHelper.cpp
More file actions
51 lines (45 loc) · 1.23 KB
/
ExplosionHelper.cpp
File metadata and controls
51 lines (45 loc) · 1.23 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
#include "ExplosionHelper.hpp"
#include "Components.hpp"
#include "EntitySystem.hpp"
void ExplosionHelper::set_delta(EntitySystem& ents, std::size_t id, Ogre::Real val)
{
auto comp = ents.get_component<ExplosionComponent>(id);
if(comp)
comp->delta = val;
}
Ogre::Real ExplosionHelper::get_delta(EntitySystem& ents, std::size_t id)
{
auto comp = ents.get_component<ExplosionComponent>(id);
if(comp)
return comp->delta;
else
return Ogre::Real{};
}
void ExplosionHelper::set_max_radius(EntitySystem& ents, std::size_t id, Ogre::Real val)
{
auto comp = ents.get_component<ExplosionComponent>(id);
if(comp)
comp->max_radius = val;
}
Ogre::Real ExplosionHelper::get_max_radius(EntitySystem& ents, std::size_t id)
{
auto comp = ents.get_component<ExplosionComponent>(id);
if(comp)
return comp->max_radius;
else
return Ogre::Real{};
}
Ogre::Real ExplosionHelper::get_curr_radius(EntitySystem& ents, std::size_t id)
{
auto comp = ents.get_component<ExplosionComponent>(id);
if(comp)
return comp->curr_radius;
else
return Ogre::Real{};
}
void ExplosionHelper::increase_curr_radius(EntitySystem& ents, std::size_t id, Ogre::Real val)
{
auto comp = ents.get_component<ExplosionComponent>(id);
if(comp)
comp->curr_radius += val;
}