using System;
using System.Collections.Generic;
using System.Text;
namespace Substrate.Nbt
{
///
/// A concrete representing a .
///
public sealed class SchemaNodeIntArray : SchemaNode
{
private int _length;
///
/// Gets the expected length of the corresponding int array.
///
public int Length
{
get { return _length; }
}
///
/// Indicates whether there is an expected length of the corresponding int array.
///
public bool HasExpectedLength
{
get { return _length > 0; }
}
///
/// Constructs a new representing a named .
///
/// The name of the corresponding .
public SchemaNodeIntArray (string name)
: base(name)
{
_length = 0;
}
///
/// Constructs a new with additional options.
///
/// The name of the corresponding .
/// One or more option flags modifying the processing of this node.
public SchemaNodeIntArray (string name, SchemaOptions options)
: base(name, options)
{
_length = 0;
}
///
/// Constructs a new representing a named with expected length .
///
/// The name of the corresponding .
/// The expected length of corresponding byte array.
public SchemaNodeIntArray (string name, int length)
: base(name)
{
_length = length;
}
///
/// Constructs a new with additional options.
///
/// The name of the corresponding .
/// The expected length of corresponding byte array.
/// One or more option flags modifying the processing of this node.
public SchemaNodeIntArray (string name, int length, SchemaOptions options)
: base(name, options)
{
_length = length;
}
///
/// Constructs a default satisfying the constraints of this node.
///
/// A with a sensible default value.
public override TagNode BuildDefaultTree ()
{
return new TagNodeIntArray(new int[_length]);
}
}
}