Struct EntityTagRule
- Namespace
- Vintagestory.API.Datastructures
- Assembly
- VintagestoryAPI.dll
Pair of tag arrays that is used for implementation of tag inversion for entity ai tasks
public readonly struct EntityTagRule
- Inherited Members
- Extension Methods
Constructors
EntityTagRule(ICoreAPI, IEnumerable<string>)
public EntityTagRule(ICoreAPI api, IEnumerable<string> tags)
Parameters
apiICoreAPItagsIEnumerable<string>
EntityTagRule(EntityTagArray, EntityTagArray)
public EntityTagRule(EntityTagArray tagsThatShouldBePresent, EntityTagArray tagsThatShouldBeAbsent)
Parameters
tagsThatShouldBePresentEntityTagArraytagsThatShouldBeAbsentEntityTagArray
Fields
Empty
public static readonly EntityTagRule Empty
Field Value
NotPrefix
public const string NotPrefix = "not-"
Field Value
TagsThatShouldBeAbsent
public readonly EntityTagArray TagsThatShouldBeAbsent
Field Value
TagsThatShouldBePresent
public readonly EntityTagArray TagsThatShouldBePresent
Field Value
Methods
ContainsAllFromAtLeastOne(EntityTagArray, EntityTagRule[])
Checks if entityTag contains all tags from at least one rule from rules.
public static bool ContainsAllFromAtLeastOne(EntityTagArray entityTag, EntityTagRule[] rules)
Parameters
entityTagEntityTagArrayrulesEntityTagRule[]
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Intersects(EntityTagArray)
public bool Intersects(EntityTagArray tags)
Parameters
tagsEntityTagArray
Returns
IntersectsWithEach(EntityTagArray, EntityTagRule[])
Checks if entityTag contains at least on tag from each rule from rules.
public static bool IntersectsWithEach(EntityTagArray entityTag, EntityTagRule[] rules)
Parameters
entityTagEntityTagArrayrulesEntityTagRule[]
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
operator ==(EntityTagRule, EntityTagRule)
public static bool operator ==(EntityTagRule first, EntityTagRule second)
Parameters
firstEntityTagRulesecondEntityTagRule
Returns
operator !=(EntityTagRule, EntityTagRule)
public static bool operator !=(EntityTagRule first, EntityTagRule second)
Parameters
firstEntityTagRulesecondEntityTagRule