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;
}