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
Fields
BitMask1
public readonly ulong BitMask1
Field Value
BitMask2
public readonly ulong BitMask2
Field Value
Empty
public static readonly EntityTagArray Empty
Field Value
MasksNumber
public const byte MasksNumber = 2
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 = 128
Field Value
Methods
And(EntityTagArray, EntityTagArray)
public static EntityTagArray And(EntityTagArray first, EntityTagArray second)
Parameters
first
EntityTagArraysecond
EntityTagArray
Returns
ContainsAll(EntityTagArray)
Checks if this tag array contains all tags from other
public bool ContainsAll(EntityTagArray other)
Parameters
other
EntityTagArray
Returns
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
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 EntityTagArray 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(EntityTagArray)
Checks if this tag array has at least one common tag with other
public bool Intersect(EntityTagArray other)
Parameters
other
EntityTagArray
Returns
Intersect(EntityTagArray, EntityTagArray)
Checks if two tag arrays have at least one common tag
public static bool Intersect(EntityTagArray first, EntityTagArray second)
Parameters
first
EntityTagArraysecond
EntityTagArray
Returns
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
Not(EntityTagArray)
public static EntityTagArray Not(EntityTagArray value)
Parameters
value
EntityTagArray
Returns
Or(EntityTagArray, EntityTagArray)
public static EntityTagArray Or(EntityTagArray first, EntityTagArray second)
Parameters
first
EntityTagArraysecond
EntityTagArray
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 &(EntityTagArray, EntityTagArray)
public static EntityTagArray operator &(EntityTagArray first, EntityTagArray second)
Parameters
first
EntityTagArraysecond
EntityTagArray
Returns
operator |(EntityTagArray, EntityTagArray)
public static EntityTagArray operator |(EntityTagArray first, EntityTagArray second)
Parameters
first
EntityTagArraysecond
EntityTagArray
Returns
operator ==(EntityTagArray, EntityTagArray)
public static bool operator ==(EntityTagArray first, EntityTagArray second)
Parameters
first
EntityTagArraysecond
EntityTagArray
Returns
operator !=(EntityTagArray, EntityTagArray)
public static bool operator !=(EntityTagArray first, EntityTagArray second)
Parameters
first
EntityTagArraysecond
EntityTagArray
Returns
operator ~(EntityTagArray)
public static EntityTagArray operator ~(EntityTagArray value)
Parameters
value
EntityTagArray