-
-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
-
In
void MyGame::onUpdate(f32 deltaTime)
not missing calling OEntitySystem::update ? -
In
Line 41 in 4d38177
entity->m_id = id;
I find sad to set each field this way, this is error-prone (missing one, i.e.) better to use the constructor to pass these parameters: the compiler will warn you in case of missing one. -
In
Line 54 in 4d38177
void OEntitySystem::update(f32 deltaTime)
You use m_entitiesToDestroy for not interfering deleting elements when iterating on them, but why not for createEntityInternal ? I guess you can create entities during the entity->onUpdate ? I guess a fake solution is to use mutex because creating entities at run-time will create a dead lock. But point to take into account when threading your game. Another solution would be unordered_map (confer section Iterator validity https://cplusplus.com/reference/unordered_map/unordered_map/erase/ vs https://cplusplus.com/reference/map/map/erase/) -
Risk of recursivity
Line 44 in 4d38177
entity->onCreate(); -
In
OpenGL-3D-Game-Tutorial-Series/Tutorial8_EntitySystem_Basics/OGL3D/source/OGL3D/Entity/OEntity.cpp
Line 32 in 4d38177
OEntity::~OEntity() -
In
OpenGL-3D-Game-Tutorial-Series/Tutorial8_EntitySystem_Basics/OGL3D/include/OGL3D/Entity/OEntity.h
Line 44 in 4d38177
OEntitySystem* m_entitySystem = nullptr;
PardCode
Metadata
Metadata
Assignees
Labels
No labels