Перейти к основному содержимому

NbtLongArray

sealed class

Represents an NBT tag that holds an array of signed 64-bit integers.

Declaration​

public sealed class NbtLongArray : NbtTag
NamespaceMcProtoNet.NBT
AssemblyMcProtoNet.NBT.dll
Sourcesrc/McProtoNet.NBT/Tags/NbtLongArray.cs#L8 ↗

Inheritance: object → NbtLongArray

Constructors​

SignatureDescription
NbtLongArray()Initializes a new instance of the NbtLongArray class that is unnamed and holds an empty array.
NbtLongArray(NbtLongArray other)Initializes a new instance of the NbtLongArray class that is a deep copy of the specified tag.
NbtLongArray(long[] value)Initializes a new instance of the NbtLongArray class that is unnamed and holds a copy of the specified array.
NbtLongArray(string? tagName)Initializes a new instance of the NbtLongArray class with the specified name that holds an empty array.
NbtLongArray(string? tagName, long[] value)Initializes a new instance of the NbtLongArray class with the specified name that holds a copy of the specified array.

NbtLongArray()​

public NbtLongArray()

Initializes a new instance of the NbtLongArray class that is unnamed and holds an empty array.

NbtLongArray(NbtLongArray)​

public NbtLongArray(NbtLongArray other)

Initializes a new instance of the NbtLongArray class that is a deep copy of the specified tag.

The array of the source tag is cloned.

Parameters: other (NbtLongArray)

Exceptions: ArgumentNullException - other is null.

NbtLongArray(long[])​

public NbtLongArray(long[] value)

Initializes a new instance of the NbtLongArray class that is unnamed and holds a copy of the specified array.

The array is cloned. Setting NbtLongArray.Value stores an array without copying it.

Parameters: value (long[])

Exceptions: ArgumentNullException - value is null.

NbtLongArray(string?)​

public NbtLongArray(string? tagName)

Initializes a new instance of the NbtLongArray class with the specified name that holds an empty array.

Parameters: tagName (string)

NbtLongArray(string?, long[])​

public NbtLongArray(string? tagName, long[] value)

Initializes a new instance of the NbtLongArray class with the specified name that holds a copy of the specified array.

The array is cloned. Setting NbtLongArray.Value stores an array without copying it.

Parameters: tagName (string), value (long[])

Exceptions: ArgumentNullException - value is null.

Properties​

SignatureDescription
long this[int index]Gets or sets the 64-bit integer at the specified index.
NbtTagType TagTypeGets the type of this tag, which is always NbtTagType.LongArray.
long[] ValueGets or sets the array held by this tag.

this[int]​

public long this[int index] { get; set; }

Gets or sets the 64-bit integer at the specified index.

Parameters: index (int)

Returns: long - The 64-bit integer at the specified index.

Exceptions: IndexOutOfRangeException - index is outside the bounds of the array.

TagType​

public override NbtTagType TagType { get; }

Gets the type of this tag, which is always NbtTagType.LongArray.

Returns: NbtTagType

Value​

public long[] Value { get; set; }

Gets or sets the array held by this tag.

The array is stored by reference and is not cloned.

Returns: long[]

Exceptions: ArgumentNullException - The property is set to null.

Methods​

SignatureDescription
object Clone()When overridden in a derived class, creates a deep copy of this tag.

Clone()​

public override object Clone()

When overridden in a derived class, creates a deep copy of this tag.

Returns: object - A new NbtTag that is a deep copy of this instance. The copy has no parent.