public get ( int from, int to ) : |
||
from | int | the low index (inclusive) |
to | int | the high index (exclusive) |
return |
public bool isInterested(BitSet componentBits) { // Check if the entity possesses ALL of the components defined in the aspect. if (!allSet.isEmpty()) { for (int i = allSet.nextSetBit(0); i >= 0; i = allSet.nextSetBit(i + 1)) { if (!componentBits.get(i)) { return(false); } } } // If we are STILL interested, // Check if the entity possesses ANY of the exclusion components, if it does then the system is not interested. if (!exclusionSet.isEmpty() && exclusionSet.intersects(componentBits)) { return(false); } // If we are STILL interested, // Check if the entity possesses ANY of the components in the oneSet. If so, the system is interested. if (!oneSet.isEmpty() && !oneSet.intersects(componentBits)) { return(false); } return(true); }
public bool isInterested( BitSet componentBits ) { // Check if the entity possesses ALL of the components defined in the aspect. if( !allSet.isEmpty() ) { for( int i = allSet.nextSetBit( 0 ); i >= 0; i = allSet.nextSetBit( i + 1 ) ) { if( !componentBits.get( i ) ) { return false; } } } // If we are STILL interested, // Check if the entity possesses ANY of the exclusion components, if it does then the system is not interested. if( !exclusionSet.isEmpty() && exclusionSet.intersects( componentBits ) ) { return false; } // If we are STILL interested, // Check if the entity possesses ANY of the components in the oneSet. If so, the system is interested. if( !oneSet.isEmpty() && !oneSet.intersects( componentBits ) ) { return false; } return true; }
public static IEnumerable<Type> getTypesFromBits( BitSet bits ) { foreach( var keyValuePair in _componentTypesMask ) { if( bits.get( keyValuePair.Value ) ) yield return keyValuePair.Key; } }
public static IEnumerable <Type> getTypesFromBits(BitSet bits) { foreach (var keyValuePair in _componentTypesMask) { if (bits.get(keyValuePair.Value)) { yield return(keyValuePair.Key); } } }