-some usefull functions for IDManager
-added EntityManager.removeEntity(EntityID) -EntitiesBlock now has ID usefull for updating first_free_block in EntityInfo
This commit is contained in:
parent
ae53e13d42
commit
d3222eefbb
4 changed files with 109 additions and 25 deletions
|
|
@ -5,15 +5,6 @@ import ecs.manager;
|
|||
|
||||
struct System
|
||||
{
|
||||
///should system update and catch events?
|
||||
bool m_enabled = false;
|
||||
///system priority
|
||||
int prority;
|
||||
///pointer to system implementation
|
||||
void* system_pointer;
|
||||
|
||||
uint[] components;
|
||||
|
||||
bool enabled()
|
||||
{
|
||||
return m_enabled;
|
||||
|
|
@ -21,18 +12,34 @@ struct System
|
|||
|
||||
void enable()
|
||||
{
|
||||
if(!m_enabled && m_enable)m_enable(system_pointer);
|
||||
if(!m_enabled && m_enable)m_enable(m_system_pointer);
|
||||
m_enabled = true;
|
||||
}
|
||||
|
||||
void disable()
|
||||
{
|
||||
if(m_enabled && m_disable)m_disable(system_pointer);
|
||||
if(m_enabled && m_disable)m_disable(m_system_pointer);
|
||||
m_enabled = false;
|
||||
}
|
||||
|
||||
int priority()
|
||||
{
|
||||
return m_priority;
|
||||
}
|
||||
|
||||
package:
|
||||
|
||||
///should system update and catch events?
|
||||
bool m_enabled = false;
|
||||
///system priority
|
||||
int m_priority;
|
||||
///pointer to system implementation
|
||||
void* m_system_pointer;
|
||||
|
||||
uint[] m_components;
|
||||
|
||||
//void function(ref EntityManager.CallData data, void* entity) update;
|
||||
void* update; ///workaroud for DMD bug with upper line
|
||||
void* m_update; ///workaroud for DMD bug with upper line
|
||||
|
||||
void function(void* system_pointer) m_enable;
|
||||
void function(void* system_pointer) m_disable;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue