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
Fields
BitMask1
public readonly ulong BitMask1
Field Value
BitMask2
public readonly ulong BitMask2
Field Value
BitMask3
public readonly ulong BitMask3
Field Value
BitMask4
public readonly ulong BitMask4
Field Value
Empty
public static readonly BlockTagArray Empty
Field Value
MasksNumber
public const byte MasksNumber = 4
Field Value
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
Methods
And(BlockTagArray, BlockTagArray)
public static BlockTagArray And(BlockTagArray first, BlockTagArray second)
Parameters
first
BlockTagArraysecond
BlockTagArray
Returns
ContainsAll(BlockTagArray)
Checks if this tag array contains all tags from other
public bool ContainsAll(BlockTagArray other)
Parameters
other
BlockTagArray
Returns
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
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.
FromBytes(BinaryReader)
public static BlockTagArray FromBytes(BinaryReader reader)
Parameters
reader
BinaryReader
Returns
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
Intersect(BlockTagArray, BlockTagArray)
Checks if two tag arrays have at least one common tag
public static bool Intersect(BlockTagArray first, BlockTagArray second)
Parameters
first
BlockTagArraysecond
BlockTagArray
Returns
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
Not(BlockTagArray)
public static BlockTagArray Not(BlockTagArray value)
Parameters
value
BlockTagArray
Returns
Or(BlockTagArray, BlockTagArray)
public static BlockTagArray Or(BlockTagArray first, BlockTagArray second)
Parameters
first
BlockTagArraysecond
BlockTagArray
Returns
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
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
BlockTagArraysecond
BlockTagArray
Returns
operator |(BlockTagArray, BlockTagArray)
public static BlockTagArray operator |(BlockTagArray first, BlockTagArray second)
Parameters
first
BlockTagArraysecond
BlockTagArray
Returns
operator ==(BlockTagArray, BlockTagArray)
public static bool operator ==(BlockTagArray first, BlockTagArray second)
Parameters
first
BlockTagArraysecond
BlockTagArray
Returns
operator !=(BlockTagArray, BlockTagArray)
public static bool operator !=(BlockTagArray first, BlockTagArray second)
Parameters
first
BlockTagArraysecond
BlockTagArray
Returns
operator ~(BlockTagArray)
public static BlockTagArray operator ~(BlockTagArray value)
Parameters
value
BlockTagArray