ArrayTag

Simple tag with array-related functions.

Constructors

this
this(T[] value)
Undocumented in source.

Members

Functions

decode
void decode(Stream )
Undocumented in source.
encode
void encode(Stream )
Undocumented in source.
opBinary
typeof(this) opBinary(G value)

Does the same job opOpAssign does, but creates a new instance of typeof(this) with the same name of the tag and returns it.

opOpAssign
void opOpAssign(G value)

Concatenates T, an array of T or a NBT array of T to the tag.

remove
void remove(size_t index)

Removes the element at the given index from the array.

rename
Tag rename(string )
Undocumented in source.
toJSON
JSONValue toJSON()
Undocumented in source.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

empty
bool empty [@property getter]

Checks whether or not the array's length is equals to 0.

type
NBT_TYPE type [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

value
T[] value;
Undocumented in source.

Inherited Members

From Tag

_named
bool _named;
Undocumented in source.
_name
string _name;
Undocumented in source.
type
NBT_TYPE type [@property getter]

Gets the tag's type.

named
bool named()

Indicates whether the tag has a name.

name
string name()

Gets the tag's name, if there's one.

rename
Tag rename(string )

Creates a NamedTag maintaing the tag's properties.

encode
void encode(Stream )

Encodes the tag's body.

decode
void decode(Stream )

Decodes the tag's body.

toJSON
JSONValue toJSON()

Encodes the tag's value as json.

toString
string toString()

Encodes the tag a human-readable string.

Examples

assert(new ByteArray([2, 3, 4]).length == new IntArray([9, 0, 12]).length);

auto b = new ByteArray();
assert(b.empty);
b ~= 14;
assert(b.length == 1 && b[0] == 14);

Meta