-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathentitycontroller.cpp
More file actions
48 lines (40 loc) · 1 KB
/
entitycontroller.cpp
File metadata and controls
48 lines (40 loc) · 1 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
#include <fea/entity/entitycontroller.hpp>
namespace fea
{
void EntityController::entityCreated(EntityPtr entity)
{
if(keepEntity(entity))
{
entityKept(entity);
mEntities.emplace(entity->getId(), entity);
}
}
void EntityController::entityRemoved(EntityId entityId)
{
if(mEntities.find(entityId) != mEntities.end())
{
entityDestroyed(mEntities.at(entityId));
mEntities.erase(entityId);
}
}
bool EntityController::keepEntity(EntityPtr entity) const
{
return false;
}
void EntityController::entityKept(EntityPtr entity)
{
}
void EntityController::entityDestroyed(EntityPtr entity)
{
}
void EntityController::update(float deltaTime)
{
}
const std::unordered_map<EntityId, EntityPtr>& EntityController::getEntities() const
{
return mEntities;
}
EntityController::~EntityController()
{
}
}