コード例 #1
0
ファイル: XmlResource.cs プロジェクト: nptr/MafiaToolkit
        public void Deserialize(ushort version, Stream input, Endian endian)
        {
            this.Tag  = input.ReadStringU32(endian);
            this.Unk1 = version >= 3 ? input.ReadValueU8() != 0 : true;
            this.Name = input.ReadStringU32(endian);
            this.Unk3 = version >= 2 ? input.ReadValueU8() != 0 : false;

            if (Name == "/config/ai/battle/eval_shoottarget/shootchain_precombat")
            {
                Console.Write("st");
            }

            // Super hacky solution to unpack XMLs with xml:xsi etc.
            if (this.Unk3 == false)
            {
                long currentPositon = input.Position;

                try
                {
                    this.Content = XmlResource0.Deserialize(input, endian);
                }
                catch (Exception ex)
                {
                    input.Position = currentPositon;
                    Console.WriteLine(ex.Message);
                    bFailedToDecompile = true;
                }
            }
            else
            {
                this.Content = XmlResource1.Deserialize(input, endian);
            }
        }
コード例 #2
0
        public void Deserialize(ushort version, Stream input, Endian endian)
        {
            this.Tag  = input.ReadStringU32(endian);
            this.Unk1 = version >= 3 ? input.ReadValueU8() != 0 : true;
            this.Name = input.ReadStringU32(endian);
            this.Unk3 = version >= 2 ? input.ReadValueU8() != 0 : false;

            if (this.Unk3 == false)
            {
                this.Content = XmlResource0.Deserialize(input, endian);
            }
            else
            {
                this.Content = XmlResource1.Deserialize(input, endian);
            }
        }