Table of Contents

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 ICoreAPI
tags IEnumerable<string>

ItemTagRule(ItemTagArray, ItemTagArray)

public ItemTagRule(ItemTagArray tagsThatShouldBePresent, ItemTagArray tagsThatShouldBeAbsent)

Parameters

tagsThatShouldBePresent ItemTagArray
tagsThatShouldBeAbsent ItemTagArray

Fields

Empty

public static readonly ItemTagRule Empty

Field Value

ItemTagRule

NotPrefix

public const string NotPrefix = "not-"

Field Value

string

TagsThatShouldBeAbsent

public readonly ItemTagArray TagsThatShouldBeAbsent

Field Value

ItemTagArray

TagsThatShouldBePresent

public readonly ItemTagArray TagsThatShouldBePresent

Field Value

ItemTagArray

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 ItemTagArray
rules ItemTagRule[]

Returns

bool

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The 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

bool

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 ItemTagArray
rules ItemTagRule[]

Returns

bool

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 ItemTagRule
second ItemTagRule

Returns

bool

operator !=(ItemTagRule, ItemTagRule)

public static bool operator !=(ItemTagRule first, ItemTagRule second)

Parameters

first ItemTagRule
second ItemTagRule

Returns

bool