Convenience functions to NBT list tag type

This commit is contained in:
Justin Aquadro 2011-10-09 00:13:30 -04:00
parent 2ecac106ac
commit 14657bf4a9

View file

@ -84,6 +84,16 @@ namespace Substrate.Nbt
return list;
}
/// <summary>
/// Finds the first subnode that matches the conditions defined by the specified predicate.
/// </summary>
/// <param name="match">The <see cref="Predicate{TagNode}"/> delegate that defines the conditions of the subnode to search for.</param>
/// <returns>The first subnode matching the predicate.</returns>
public TagNode Find (Predicate<TagNode> match)
{
return _items.Find(match);
}
/// <summary>
/// Retrieves all the subnodes that match the conditions defined by the specified predicate.
/// </summary>
@ -104,6 +114,32 @@ namespace Substrate.Nbt
return _items.RemoveAll(match);
}
/// <summary>
/// Reverses the order of all the subnodes in the list.
/// </summary>
public void Reverse ()
{
_items.Reverse();
}
/// <summary>
/// Reverse the order of subnodes in the specified range.
/// </summary>
/// <param name="index">The zero-based starting index of the subnodes to reverse</param>
/// <param name="count">The number of subnodes in the range to reverse.</param>
public void Reverse (int index, int count)
{
_items.Reverse(index, count);
}
/// <summary>
/// Sorts all the subnodes in the list using the default comparator
/// </summary>
public void Sort ()
{
_items.Sort();
}
/// <summary>
/// Gets a string representation of the node's data.
/// </summary>