示例#1
0
        public static void Construct(EntityQueryCache *cache)
        {
            cache->typeLookup = HashMap <EntityQuery> .Empty();

            cache->count    = 0;
            cache->capacity = cache->typeLookup.capacity;
            cache->queries  = MemoryUtility.Malloc <EntityQueryData>(cache->capacity);
        }
示例#2
0
        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);
        }