Struct ItemTagRule
- Namespace
- Vintagestory.API.Datastructures
- Assembly
- VintagestoryAPI.dll
Pair of tag arrays that is used for implementation of tag inversion
public readonly struct ItemTagRule
- Inherited Members
- Extension Methods
Constructors
ItemTagRule(ICoreAPI, IEnumerable<string>)
public ItemTagRule(ICoreAPI api, IEnumerable<string> tags)
Parameters
api
ICoreAPItags
IEnumerable<string>
ItemTagRule(ItemTagArray, ItemTagArray)
public ItemTagRule(ItemTagArray tagsThatShouldBePresent, ItemTagArray tagsThatShouldBeAbsent)
Parameters
tagsThatShouldBePresent
ItemTagArraytagsThatShouldBeAbsent
ItemTagArray
Fields
Empty
public static readonly ItemTagRule Empty
Field Value
NotPrefix
public const string NotPrefix = "not-"
Field Value
TagsThatShouldBeAbsent
public readonly ItemTagArray TagsThatShouldBeAbsent
Field Value
TagsThatShouldBePresent
public readonly ItemTagArray TagsThatShouldBePresent
Field Value
Methods
ContainsAllFromAtLeastOne(ItemTagArray, ItemTagRule[])
Checks if itemTag
contains all tags from at least one rule from rules
.
public static bool ContainsAllFromAtLeastOne(ItemTagArray itemTag, ItemTagRule[] rules)
Parameters
itemTag
ItemTagArrayrules
ItemTagRule[]
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and 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(ItemTagArray)
public bool Intersects(ItemTagArray tags)
Parameters
tags
ItemTagArray
Returns
IntersectsWithEach(ItemTagArray, ItemTagRule[])
Checks if itemTag
contains at least on tag from each rule from rules
.
public static bool IntersectsWithEach(ItemTagArray itemTag, ItemTagRule[] rules)
Parameters
itemTag
ItemTagArrayrules
ItemTagRule[]
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
operator ==(ItemTagRule, ItemTagRule)
public static bool operator ==(ItemTagRule first, ItemTagRule second)
Parameters
first
ItemTagRulesecond
ItemTagRule
Returns
operator !=(ItemTagRule, ItemTagRule)
public static bool operator !=(ItemTagRule first, ItemTagRule second)
Parameters
first
ItemTagRulesecond
ItemTagRule