コード例 #1
0
        public void Read(Stream stream, VintFile vint)
        {
            this.Name = vint.Strings[stream.ReadS32()];
            this.Type = vint.Strings[stream.ReadS32()];
            UInt16 childCount = stream.ReadU16();

            byte unk4 = stream.ReadU8();

            UInt32 unk5 = stream.ReadU32();

            this.Overrides.Clear();
            if (stream.ReadU8() > 0)
            {
                string overrideName = vint.Strings[stream.ReadS32()];
                /*UInt32 overrideSize =*/ stream.ReadU32();

                if (this.Overrides.ContainsKey(overrideName))
                {
                    throw new Exception("duplicate override name");
                }

                this.Overrides[overrideName] = new Dictionary <string, VintProperty>();

                while (true)
                {
                    byte propertyType = stream.ReadU8();
                    if (propertyType == 0)
                    {
                        break;
                    }

                    UInt32 hash         = stream.ReadU32();
                    string propertyName = VintPropertyNames.Lookup(hash);
                    if (this.Overrides[overrideName].ContainsKey(propertyName))
                    {
                        throw new Exception("duplicate override property name");
                    }
                    this.Overrides[overrideName][propertyName] = this.GetProperty(stream, propertyType);
                    this.Overrides[overrideName][propertyName].Read(stream, vint);
                }
            }

            this.Baseline.Clear();
            while (true)
            {
                byte propertyType = stream.ReadU8();
                if (propertyType == 0)
                {
                    break;
                }

                UInt32 hash         = stream.ReadU32();
                string propertyName = VintPropertyNames.Lookup(hash);
                if (this.Baseline.ContainsKey(propertyName))
                {
                    throw new Exception("duplicate baseline property name");
                }
                this.Baseline[propertyName] = this.GetProperty(stream, propertyType);
                this.Baseline[propertyName].Read(stream, vint);
            }

            for (int i = 0; i < childCount; i++)
            {
                VintObject child = new VintObject();
                child.Read(stream, vint);
                this.Children.Add(child);
            }
        }
コード例 #2
0
 public override void Read(Stream stream, VintFile vint)
 {
     this.X = stream.ReadF32();
     this.Y = stream.ReadF32();
 }
コード例 #3
0
 public override void Read(Stream stream, VintFile vint)
 {
     this.Value = vint.Strings[stream.ReadS32()];
 }
コード例 #4
0
 public override void Read(Stream stream, VintFile vint)
 {
     this.Value = stream.ReadBoolean();
 }
コード例 #5
0
 public abstract void Read(Stream stream, VintFile vint);