Пример #1
0
        public void Write(TngBinaryWriter writer)
        {
            writer.Write(InfoId);

            if (Id != -1)
            {
                writer.Write(Id);

                foreach (KeyValuePair <string, object> data in Data)
                {
                    writer.WriteObject(data.Value);
                }

                writer.Write(ChildEntry.Length);
                for (int i = 0; i < ChildEntry.Length; i++)
                {
                    ChildEntry[i].Write(writer);
                }
            }
            else
            {
                foreach (KeyValuePair <string, object> data in Data)
                {
                    writer.WriteObject(data.Value);
                }
            }
        }
Пример #2
0
        public void Write(System.IO.Stream fileStream)
        {
            using (TngBinaryWriter writer = new TngBinaryWriter(EndianBitConverter.Little, fileStream))
            {
                writer.Write(magic);
                writer.Write(TngEntry.Length);
                writer.Write(infoSize);

                foreach (KeyValuePair <int, TngInfo> tngInfo in TngInfo)
                {
                    writer.WriteTerminatedString(tngInfo.Value.Name, 0x00);
                }

                for (int i = 0; i < TngEntry.Length; i++)
                {
                    TngEntry[i].Write(writer);
                }
            }
        }
Пример #3
0
        public void Write(TngBinaryWriter writer)
        {
            writer.Write(InfoId);

            if (Id != -1)
            {
                writer.Write(Id);

                foreach (KeyValuePair<string, object> data in Data)
                {
                    writer.WriteObject(data.Value);
                }

                writer.Write(ChildEntry.Length);
                for (int i = 0; i < ChildEntry.Length; i++)
                {
                    ChildEntry[i].Write(writer);
                }
            }
            else
            {
                foreach (KeyValuePair<string, object> data in Data)
                {
                    writer.WriteObject(data.Value);
                }
            }
        }
Пример #4
0
        public void Write(System.IO.Stream fileStream)
        {
            using (TngBinaryWriter writer = new TngBinaryWriter(EndianBitConverter.Little, fileStream))
            {
                writer.Write(magic);
                writer.Write(TngEntry.Length);
                writer.Write(infoSize);

                foreach (KeyValuePair<int, TngInfo> tngInfo in TngInfo)
                {
                    writer.WriteTerminatedString(tngInfo.Value.Name, 0x00);
                }

                for (int i = 0; i < TngEntry.Length; i++)
                {
                    TngEntry[i].Write(writer);
                }
            }
        }