コード例 #1
0
        /// <summary>Gets the bit-register for the specified entity system.</summary>
        /// <param name="entitySystem">The entity system.</param>
        /// <returns>The bit flag register for the specified system.</returns>
        public static BigInteger GetBitFor(EntitySystem entitySystem)
        {
            BigInteger bit;
            if (SystemBits.TryGetValue(entitySystem, out bit) == false)
            {
            #if WINDOWS_PHONE || XBOX || PORTABLE
                bit = 1 << position;
            #else
                bit = 1L << position;
            #endif
                ++position;
                SystemBits.Add(entitySystem, bit);
            }

            return bit;
        }
コード例 #2
0
        /// <summary>Gets the bit-register for the specified entity system.</summary>
        /// <param name="entitySystem">The entity system.</param>
        /// <returns>The bit flag register for the specified system.</returns>
        public BigInteger GetBitFor(EntitySystem entitySystem)
        {
            BigInteger bit;
            if (this.systemBits.TryGetValue(entitySystem, out bit) == false)
            {
#if WINDOWS_PHONE || XBOX || PORTABLE || FORCEINT32
                if (this.position == 32)
                {
                    // bit is going to overflow and become 1 again
                    throw new InvalidOperationException("EntitySystem instances limit reached: number of EntitySystem instances is restricted to 32 in the current Artemis build.");
                }

                bit = 1 << this.position;
#else
                bit = 1L << this.position;
#endif
                this.position++;
                this.systemBits.Add(entitySystem, bit);
            }

            return bit;
        }
コード例 #3
0
 /// <summary>Initializes a new instance of the <see cref="EntityProcessingSystem"/> class.</summary>
 /// <param name="requiredType">The required Type.</param>
 /// <param name="otherTypes">The optional other types.</param>
 protected EntityProcessingSystem(Type requiredType, params Type[] otherTypes)
     : base(EntitySystem.GetMergedTypes(requiredType, otherTypes))
 {
 }