Table of Contents

Struct Rule

Namespace
Frent.Systems
Assembly
Frent.dll

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

Rule

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

Rule

A Rule configured with the custom delegate.

Equals(Rule)

Determines whether this Rule is equal to another Rule.

public bool Equals(Rule other)

Parameters

other Rule

The Rule to compare against.

Returns

bool

true if the rules are equal, false otherwise.

Equals(object?)

Determines whether this Rule is equal to an object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare against.

Returns

bool

true if the object is a Rule and they are equal, false otherwise.

GetHashCode()

Gets a hash code for this Rule.

public override int GetHashCode()

Returns

int

A hash code representing this Rule.

HasComponent(ComponentID)

Creates a rule that applies when an archetype has the specified component.

public static Rule HasComponent(ComponentID compID)

Parameters

compID ComponentID

The ID of the component to check for.

Returns

Rule

A Rule that checks for the presence of a component.

HasTag(TagID)

Creates a rule that applies when an archetype has the specified tag.

public static Rule HasTag(TagID tagID)

Parameters

tagID TagID

The ID of the tag to check for.

Returns

Rule

A Rule that checks for the presence of a tag.

NotComponent(ComponentID)

Creates a rule that applies when an archetype does not have the specified component.

public static Rule NotComponent(ComponentID compID)

Parameters

compID ComponentID

The ID of the component to check for absence.

Returns

Rule

A Rule that checks for the absence of a component.

NotTag(TagID)

Creates a rule that applies when an archetype does not have the specified tag.

public static Rule NotTag(TagID tagID)

Parameters

tagID TagID

The ID of the tag to check for absence.

Returns

Rule

A Rule that checks for the absence of a tag.

Operators

operator ==(Rule, Rule)

Determines whether two Rule instances are equal.

public static bool operator ==(Rule left, Rule right)

Parameters

left Rule

The first rule to compare.

right Rule

The second rule to compare.

Returns

bool

true if the rules are equal, false otherwise.

operator !=(Rule, Rule)

Determines whether two Rule instances are not equal.

public static bool operator !=(Rule left, Rule right)

Parameters

left Rule

The first rule to compare.

right Rule

The second rule to compare.

Returns

bool

true if the rules are not equal, false otherwise.