Add missing export visibility attributes
This commit is contained in:
parent
50fa2ce19c
commit
9b75772039
4 changed files with 18 additions and 8 deletions
|
|
@ -44,7 +44,7 @@ struct Entity
|
||||||
return cast(T*)getComponent(becsID!T);
|
return cast(T*)getComponent(becsID!T);
|
||||||
}
|
}
|
||||||
|
|
||||||
void* getComponent(ushort component_id) const
|
export void* getComponent(ushort component_id) const
|
||||||
{
|
{
|
||||||
EntityManager.EntitiesBlock* block = gEntityManager.getMetaData(&this);
|
EntityManager.EntitiesBlock* block = gEntityManager.getMetaData(&this);
|
||||||
EntityManager.EntityInfo* info = block.type_info;
|
EntityManager.EntityInfo* info = block.type_info;
|
||||||
|
|
@ -54,7 +54,7 @@ struct Entity
|
||||||
return (cast(void*)block + info.deltas[component_id] + block.entityIndex(&this) * gEntityManager.components[component_id].size);
|
return (cast(void*)block + info.deltas[component_id] + block.entityIndex(&this) * gEntityManager.components[component_id].size);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasComponent(ushort component_id) const
|
export bool hasComponent(ushort component_id) const
|
||||||
{
|
{
|
||||||
EntityManager.EntitiesBlock* block = gEntityManager.getMetaData(&this);
|
EntityManager.EntitiesBlock* block = gEntityManager.getMetaData(&this);
|
||||||
EntityManager.EntityInfo* info = block.type_info;
|
EntityManager.EntityInfo* info = block.type_info;
|
||||||
|
|
@ -62,7 +62,7 @@ struct Entity
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityMeta getMeta() const
|
export EntityMeta getMeta() const
|
||||||
{
|
{
|
||||||
EntityMeta meta;
|
EntityMeta meta;
|
||||||
meta.block = gEntityManager.getMetaData(&this);
|
meta.block = gEntityManager.getMetaData(&this);
|
||||||
|
|
@ -85,7 +85,7 @@ struct EntityMeta
|
||||||
return cast(T*)getComponent(becsID!T);
|
return cast(T*)getComponent(becsID!T);
|
||||||
}
|
}
|
||||||
|
|
||||||
void* getComponent(ushort component_id) const
|
export void* getComponent(ushort component_id) const
|
||||||
{
|
{
|
||||||
const (EntityManager.EntityInfo)* info = block.type_info;
|
const (EntityManager.EntityInfo)* info = block.type_info;
|
||||||
|
|
||||||
|
|
@ -95,7 +95,7 @@ struct EntityMeta
|
||||||
return (cast(void*)block + info.deltas[component_id] + index * gEntityManager.components[component_id].size);
|
return (cast(void*)block + info.deltas[component_id] + index * gEntityManager.components[component_id].size);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasComponent(ushort component_id) const
|
export bool hasComponent(ushort component_id) const
|
||||||
{
|
{
|
||||||
const EntityManager.EntityInfo* info = block.type_info;
|
const EntityManager.EntityInfo* info = block.type_info;
|
||||||
if (component_id >= info.deltas.length || info.deltas[component_id] == 0)return false;
|
if (component_id >= info.deltas.length || info.deltas[component_id] == 0)return false;
|
||||||
|
|
@ -133,7 +133,7 @@ export struct EntityTemplate
|
||||||
/************************************************************************************************************************
|
/************************************************************************************************************************
|
||||||
Get specified component. If component doesn't exist function return null. Returned pointer is valid during EntityTemplate lifetime.
|
Get specified component. If component doesn't exist function return null. Returned pointer is valid during EntityTemplate lifetime.
|
||||||
*/
|
*/
|
||||||
void* getComponent(ushort component_id) const nothrow @nogc
|
export void* getComponent(ushort component_id) const nothrow @nogc
|
||||||
{
|
{
|
||||||
if(component_id >= info.tmpl_deltas.length || info.tmpl_deltas[component_id] == ushort.max)return null;
|
if(component_id >= info.tmpl_deltas.length || info.tmpl_deltas[component_id] == ushort.max)return null;
|
||||||
return cast(void*)(entity_data.ptr + info.tmpl_deltas[component_id]);
|
return cast(void*)(entity_data.ptr + info.tmpl_deltas[component_id]);
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ export ulong defaultHashFunc(T)(auto ref T t) nothrow @nogc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ulong hash(byte[] array) nothrow @nogc
|
export ulong hash(byte[] array) nothrow @nogc
|
||||||
{
|
{
|
||||||
ulong hash = 0;
|
ulong hash = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3355,6 +3355,16 @@ export struct EntityManager
|
||||||
export ~this() nothrow @nogc
|
export ~this() nothrow @nogc
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export void opAssign(ComponentInfo c)
|
||||||
|
{
|
||||||
|
size = c.size;
|
||||||
|
alignment = c.alignment;
|
||||||
|
init_data = c.init_data;
|
||||||
|
destroy_callback = c.destroy_callback;
|
||||||
|
create_callback = c.create_callback;
|
||||||
|
}
|
||||||
|
|
||||||
///Component size
|
///Component size
|
||||||
ushort size;
|
ushort size;
|
||||||
///Component data alignment
|
///Component data alignment
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ struct System
|
||||||
package:
|
package:
|
||||||
|
|
||||||
///destory system. Dispose all data
|
///destory system. Dispose all data
|
||||||
void destroy() nothrow @nogc
|
export void destroy() nothrow @nogc
|
||||||
{
|
{
|
||||||
import bubel.ecs.std : Mallocator;
|
import bubel.ecs.std : Mallocator;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue