コード例 #1
0
        private ArcheType CreateArcheType(Entity entity)
        {
            var types = GetComponentTypes(entity);

            int hashCode = ArcheTypeEqualityComparer.GetHashCode(types);

#warning can probably remove allocation if customizing set to be only for this type
            var acheType = _archTypes.GetOrAddByHash(hashCode, (hash) => new ArcheType(types));

            _archeTypeMap.TryAdd(acheType, CreateArcheTypeEntitySet());

            return(acheType);
        }
コード例 #2
0
        internal ArcheType GetArcheType(Type[] components)
        {
            int hashCode = ArcheTypeEqualityComparer.GetHashCode(components);

            return(_archTypes.GetByHash(hashCode));
        }