Exemple #1
0
 private void GoUp()
 {
     if (nodes == null || nodes.Count == 0)
     {
         IsDone = true;
     }
     else
     {
         NbtWriterNode oldNode = nodes.Pop();
         parentType = oldNode.ParentType;
         listType   = oldNode.ListType;
         listSize   = oldNode.ListSize;
         listIndex  = oldNode.ListIndex;
     }
 }
Exemple #2
0
        private void GoDown(NbtTagType thisType)
        {
            if (nodes == null)
            {
                nodes = new Stack <NbtWriterNode>();
            }
            var newNode = new NbtWriterNode
            {
                ParentType = parentType,
                ListType   = listType,
                ListSize   = listSize,
                ListIndex  = listIndex
            };

            nodes.Push(newNode);

            parentType = thisType;
            listType   = NbtTagType.Unknown;
            listSize   = 0;
            listIndex  = 0;
        }