Beispiel #1
0
        public void Write(NodeWriter writer, NodeEntry node)
        {
            var data = (ItemDropStorage)node.Value;

            writer.WritePackedString(data.UnknownString);
            writer.Write(data.HeaderBytes);
            InventoryParser.WriteSubInventory(writer, data.Inventory);
        }
        public byte[] Write(NodeEntry node, List <INodeParser> parsers)
        {
            byte[] result;
            var    data = (ItemDropStorage)node.Value;

            using (var stream = new MemoryStream())
            {
                using (var writer = new BinaryWriter(stream, Encoding.ASCII))
                {
                    writer.Write(node.Id);
                    ParserUtils.WriteString(writer, data.UnknownString);
                    writer.Write(data.HeaderBytes);
                    InventoryParser.WriteSubInventory(node, 0, writer, data.Inventory, parsers);
                }
                result = stream.ToArray();
            }
            return(result);
        }