Potato Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
Entity.cpp
Go to the documentation of this file.
1
2
3
#include <algorithm>
4
5
#include "
Entity.hpp
"
6
7
Entity::Entity() {
8
9
}
10
11
Entity::~Entity() {
12
13
}
14
15
float
Entity::TakeDamage
(
float
damage) {
16
Health = std::clamp(Health - damage, 0.f, MaxHealth);
17
return
Health;
18
}
19
20
float
Entity::AddHealth
(
float
amount) {
21
Health = std::clamp(Health + amount, 0.f, MaxHealth);
22
return
Health;
23
}
24
25
float
Entity::GetHealth
()
const
{
26
return
Health;
27
}
Entity.hpp
Entity::AddHealth
float AddHealth(float amount)
Adds health to entity.
Definition
Entity.cpp:20
Entity::GetHealth
float GetHealth() const
Gets health.
Definition
Entity.cpp:25
Entity::TakeDamage
float TakeDamage(float damage)
Delivers damage to the entity.
Definition
Entity.cpp:15
Game
Actors
Entity.cpp
Generated by
1.17.0