SDL SPOOKY PLATFORMER ENGINE
0.2.0
An implementation of a platformer using sdl, implemented using an entity component system and efficient collision management.
Main Page
Related Pages
Classes
Files
File List
File Members
include
utils
ComponentUtils.hpp
Go to the documentation of this file.
1
#ifndef COMPONENT_UTILS_CPP
2
#define COMPONENT_UTILS_CPP
3
4
#include "
GameObject.hpp
"
5
#include "
Component.hpp
"
6
7
template
<
typename
C>
8
C*
SafeGetComponentField
(C* field,
const
GameObject
& entity) {
9
if
(!field) {
10
return
entity.
GetComponent
<C>();
11
}
12
return
field;
13
}
14
15
#endif
GameObject::GetComponent
C * GetComponent() const
Get a component.
GameObject
Definition:
GameObject.hpp:12
SafeGetComponentField
C * SafeGetComponentField(C *field, const GameObject &entity)
Definition:
ComponentUtils.hpp:8
Component.hpp
GameObject.hpp
Generated on Tue Mar 16 2021 02:10:18 for SDL SPOOKY PLATFORMER ENGINE by
1.4.1