public static void Construct(ArchetypeStore *store) { store->typeLookup = HashMap <EntityArchetype> .Empty(); store->count = 0; store->capacity = store->typeLookup.capacity; store->archetypes = MemoryUtility.Malloc <Archetype>(store->capacity); }
private void Construct() { // Revisit with threading (cache invalidation). byte *ptr = MemoryUtility.Malloc <byte>( sizeof(ArchetypeStore) + sizeof(EntityStore) + sizeof(EntityQueryCache)); this.archetypeStore = (ArchetypeStore *)ptr; this.entityStore = (EntityStore *)(ptr += sizeof(ArchetypeStore)); this.queryCache = (EntityQueryCache *)(ptr += sizeof(EntityStore)); ArchetypeStore.Construct(this.archetypeStore); EntityStore.Construct(this.entityStore); EntityQueryCache.Construct(this.queryCache); }