// Goes one step up the NBT file's hierarchy, restoring previous state void GoUp() { NbtReaderNode oldNode = nodes.Pop(); ParentName = oldNode.ParentName; ParentTagType = oldNode.ParentTagType; ParentTagLength = oldNode.ParentTagLength; ListIndex = oldNode.ListIndex; ListType = oldNode.ListType; TagLength = 0; Depth--; }
// Goes one step down the NBT file's hierarchy, preserving current state void GoDown() { NbtReaderNode newNode = new NbtReaderNode { ListIndex = ListIndex, ParentTagLength = ParentTagLength, ParentName = ParentName, ParentTagType = ParentTagType, ListType = ListType }; nodes.Push(newNode); ParentName = TagName; ParentTagType = TagType; ParentTagLength = TagLength; ListIndex = 0; TagLength = 0; Depth++; }
// Goes one step down the NBT file's hierarchy, preserving current state void GoDown() { if (nodes == null) { nodes = new Stack <NbtReaderNode>(); } var newNode = new NbtReaderNode { ListIndex = ListIndex, ParentTagLength = ParentTagLength, ParentName = ParentName, ParentTagType = ParentTagType, ListType = ListType }; nodes.Push(newNode); ParentName = TagName; ParentTagType = TagType; ParentTagLength = TagLength; ListIndex = 0; TagLength = 0; Depth++; }