Table of Contents

Struct BlockTagArray

Namespace
Vintagestory.API.Datastructures
Assembly
VintagestoryAPI.dll

List of block tags meant to be used for fast comparisons. Restricts number of registered block tags to 256.

public readonly struct BlockTagArray
Inherited Members
Extension Methods

Constructors

BlockTagArray()

public BlockTagArray()

BlockTagArray(IEnumerable<ushort>)

public BlockTagArray(IEnumerable<ushort> tags)

Parameters

tags IEnumerable<ushort>

BlockTagArray(ushort)

public BlockTagArray(ushort tag)

Parameters

tag ushort

BlockTagArray(ulong, ulong, ulong, ulong)

public BlockTagArray(ulong bitMask1, ulong bitMask2, ulong bitMask3, ulong bitMask4)

Parameters

bitMask1 ulong
bitMask2 ulong
bitMask3 ulong
bitMask4 ulong

Fields

BitMask1

public readonly ulong BitMask1

Field Value

ulong

BitMask2

public readonly ulong BitMask2

Field Value

ulong

BitMask3

public readonly ulong BitMask3

Field Value

ulong

BitMask4

public readonly ulong BitMask4

Field Value

ulong

Empty

public static readonly BlockTagArray Empty

Field Value

BlockTagArray

MasksNumber

public const byte MasksNumber = 4

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 = 256

Field Value

int

Methods

And(BlockTagArray, BlockTagArray)

public static BlockTagArray And(BlockTagArray first, BlockTagArray second)

Parameters

first BlockTagArray
second BlockTagArray

Returns

BlockTagArray

ContainsAll(BlockTagArray)

Checks if this tag array contains all tags from other

public bool ContainsAll(BlockTagArray other)

Parameters

other BlockTagArray

Returns

bool

ContainsAllFromAtLeastOne(BlockTagArray[])

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

public bool ContainsAllFromAtLeastOne(BlockTagArray[] tags)

Parameters

tags BlockTagArray[]

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 BlockTagArray FromBytes(BinaryReader reader)

Parameters

reader BinaryReader

Returns

BlockTagArray

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(BlockTagArray)

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

public bool Intersect(BlockTagArray other)

Parameters

other BlockTagArray

Returns

bool

Intersect(BlockTagArray, BlockTagArray)

Checks if two tag arrays have at least one common tag

public static bool Intersect(BlockTagArray first, BlockTagArray second)

Parameters

first BlockTagArray
second BlockTagArray

Returns

bool

IntersectsWithEach(BlockTagArray[])

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

public bool IntersectsWithEach(BlockTagArray[] tags)

Parameters

tags BlockTagArray[]

Returns

bool

Not(BlockTagArray)

public static BlockTagArray Not(BlockTagArray value)

Parameters

value BlockTagArray

Returns

BlockTagArray

Or(BlockTagArray, BlockTagArray)

public static BlockTagArray Or(BlockTagArray first, BlockTagArray second)

Parameters

first BlockTagArray
second BlockTagArray

Returns

BlockTagArray

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 &(BlockTagArray, BlockTagArray)

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

Parameters

first BlockTagArray
second BlockTagArray

Returns

BlockTagArray

operator |(BlockTagArray, BlockTagArray)

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

Parameters

first BlockTagArray
second BlockTagArray

Returns

BlockTagArray

operator ==(BlockTagArray, BlockTagArray)

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

Parameters

first BlockTagArray
second BlockTagArray

Returns

bool

operator !=(BlockTagArray, BlockTagArray)

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

Parameters

first BlockTagArray
second BlockTagArray

Returns

bool

operator ~(BlockTagArray)

public static BlockTagArray operator ~(BlockTagArray value)

Parameters

value BlockTagArray

Returns

BlockTagArray