Table of Contents

Struct EntityTagArray

Namespace
Vintagestory.API.Datastructures
Assembly
VintagestoryAPI.dll

List of entity tags meant to be used for fast comparisons. Restricts number of registered entity tags to 128

public readonly struct EntityTagArray
Inherited Members
Extension Methods

Constructors

EntityTagArray()

public EntityTagArray()

EntityTagArray(IEnumerable<ushort>)

public EntityTagArray(IEnumerable<ushort> tags)

Parameters

tags IEnumerable<ushort>

EntityTagArray(ushort)

public EntityTagArray(ushort tag)

Parameters

tag ushort

EntityTagArray(ulong, ulong)

public EntityTagArray(ulong bitMask1, ulong bitMask2)

Parameters

bitMask1 ulong
bitMask2 ulong

Fields

BitMask1

public readonly ulong BitMask1

Field Value

ulong

BitMask2

public readonly ulong BitMask2

Field Value

ulong

Empty

public static readonly EntityTagArray Empty

Field Value

EntityTagArray

MasksNumber

public const byte MasksNumber = 2

Field Value

byte

Size

Maximum amount of different tags supported by tag array. Limited by total amount of bits in bit masks.

public const int Size = 128

Field Value

int

Methods

And(EntityTagArray, EntityTagArray)

public static EntityTagArray And(EntityTagArray first, EntityTagArray second)

Parameters

first EntityTagArray
second EntityTagArray

Returns

EntityTagArray

ContainsAll(EntityTagArray)

Checks if this tag array contains all tags from other

public bool ContainsAll(EntityTagArray other)

Parameters

other EntityTagArray

Returns

bool

ContainsAllFromAtLeastOne(EntityTagArray[])

Checks if this tag array contains all tags from at least one element of tags

public bool ContainsAllFromAtLeastOne(EntityTagArray[] tags)

Parameters

tags EntityTagArray[]

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.

FromBytes(BinaryReader)

public static EntityTagArray FromBytes(BinaryReader reader)

Parameters

reader BinaryReader

Returns

EntityTagArray

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.

Intersect(EntityTagArray)

Checks if this tag array has at least one common tag with other

public bool Intersect(EntityTagArray other)

Parameters

other EntityTagArray

Returns

bool

Intersect(EntityTagArray, EntityTagArray)

Checks if two tag arrays have at least one common tag

public static bool Intersect(EntityTagArray first, EntityTagArray second)

Parameters

first EntityTagArray
second EntityTagArray

Returns

bool

IntersectsWithEach(EntityTagArray[])

Checks if this tag array contains at least on tag from each element of tags

public bool IntersectsWithEach(EntityTagArray[] tags)

Parameters

tags EntityTagArray[]

Returns

bool

Not(EntityTagArray)

public static EntityTagArray Not(EntityTagArray value)

Parameters

value EntityTagArray

Returns

EntityTagArray

Or(EntityTagArray, EntityTagArray)

public static EntityTagArray Or(EntityTagArray first, EntityTagArray second)

Parameters

first EntityTagArray
second EntityTagArray

Returns

EntityTagArray

ToArray()

Converts tag array into list of tag ids sorted in ascending order

public IEnumerable<ushort> ToArray()

Returns

IEnumerable<ushort>

List of tag ids in ascending order

ToArray(ICoreAPI)

Converts tag array into list of tags.

public IEnumerable<string> ToArray(ICoreAPI api)

Parameters

api ICoreAPI

Returns

IEnumerable<string>

ToBytes(BinaryWriter)

public void ToBytes(BinaryWriter writer)

Parameters

writer BinaryWriter

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator &(EntityTagArray, EntityTagArray)

public static EntityTagArray operator &(EntityTagArray first, EntityTagArray second)

Parameters

first EntityTagArray
second EntityTagArray

Returns

EntityTagArray

operator |(EntityTagArray, EntityTagArray)

public static EntityTagArray operator |(EntityTagArray first, EntityTagArray second)

Parameters

first EntityTagArray
second EntityTagArray

Returns

EntityTagArray

operator ==(EntityTagArray, EntityTagArray)

public static bool operator ==(EntityTagArray first, EntityTagArray second)

Parameters

first EntityTagArray
second EntityTagArray

Returns

bool

operator !=(EntityTagArray, EntityTagArray)

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

Parameters

first EntityTagArray
second EntityTagArray

Returns

bool

operator ~(EntityTagArray)

public static EntityTagArray operator ~(EntityTagArray value)

Parameters

value EntityTagArray

Returns

EntityTagArray