Struct Rule
Encapsulates a check for an entity, used to filter queries
public struct Rule : IEquatable<Rule>
- Implements
- Inherited Members
Fields
IncludeDisabledRule
Using this rule will include disabled entities in a query.
public static readonly Rule IncludeDisabledRule
Field Value
Methods
Delegate(Func<EntityType, bool>)
Creates a custom delegate-based rule.
public static Rule Delegate(Func<EntityType, bool> rule)
Parameters
rule
Func<EntityType, bool>The custom delegate to determine rule applicability.
Returns
Equals(Rule)
public bool Equals(Rule other)
Parameters
Returns
Equals(object?)
Determines whether this Rule is equal to an object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare against.
Returns
GetHashCode()
Gets a hash code for this Rule.
public override int GetHashCode()
Returns
HasComponent(ComponentID)
Creates a rule that applies when an archetype has the specified component.
public static Rule HasComponent(ComponentID compID)
Parameters
compID
ComponentIDThe ID of the component to check for.
Returns
HasTag(TagID)
Creates a rule that applies when an archetype has the specified tag.
public static Rule HasTag(TagID tagID)
Parameters
tagID
TagIDThe ID of the tag to check for.
Returns
NotComponent(ComponentID)
Creates a rule that applies when an archetype does not have the specified component.
public static Rule NotComponent(ComponentID compID)
Parameters
compID
ComponentIDThe ID of the component to check for absence.
Returns
NotTag(TagID)
Creates a rule that applies when an archetype does not have the specified tag.
public static Rule NotTag(TagID tagID)
Parameters
tagID
TagIDThe ID of the tag to check for absence.
Returns
Operators
operator ==(Rule, Rule)
Determines whether two Rule instances are equal.
public static bool operator ==(Rule left, Rule right)
Parameters
Returns
operator !=(Rule, Rule)
Determines whether two Rule instances are not equal.
public static bool operator !=(Rule left, Rule right)