Example #1
0
 public DeserializeList(PackedStream_2 stream, int valueState) : base(stream, HeroTypes.List)
 {
     this.index = 0;
     this.m_30  = false;
     if (stream.Flags[4])
     {
         if (base.Next == null)
         {
             throw new InvalidDataException("Only a HeroClass can be the root container type");
         }
         throw new NotImplementedException();
     }
     if (valueState != 1)
     {
         throw new InvalidDataException("Invalid value state");
     }
     if (stream.Flags[0])
     {
         ulong num;
         stream.Read(out num);
         this.listType = (HeroTypes)((int)num);
     }
     stream.Read(out this.m_0C, out this.Count);
     if ((stream.Style == 8) || (stream.Style == 10))
     {
         this.m_30  = (base.Count & 1) == 1;
         base.Count = base.Count >> 1;
     }
 }
Example #2
0
 public DeserializeClass(PackedStream_2 stream, int valueState)
     : base(stream, HeroTypes.Class)
 {
     this.m_28 = 0UL;
     this.m_30 = this.m_34 = 0;
     this.m_38 = (object)null;
     if (stream.Flags[4])
     {
         if (valueState == 0)
         {
             return;
         }
         if (valueState != 1)
         {
             throw new InvalidDataException("Invalid value state");
         }
         if (this.Next != null)
         {
             throw new NotImplementedException();
         }
         ulong num;
         this.Stream.Read(out num);
         throw new NotImplementedException();
     }
     else
     {
         if (valueState != 1)
         {
             throw new InvalidDataException("Invalid value state");
         }
         stream.Read(out this.m_0C, out this.Count);
     }
 }
 public SerializeStateBase(PackedStream_2 stream, HeroTypes heroType)
 {
     this.HeroType = heroType;
     this.Next     = null;
     this.Stream   = stream;
     this.m_0C     = 0;
     this.Count    = 0;
     this.Next     = stream.State;
     stream.State  = this;
 }
 public SerializeClass(PackedStream_2 stream, int valueState, int count) : base(stream, HeroTypes.Class)
 {
     this.m_28 = 0L;
     this.m_30 = this.m_34 = 0;
     this.m_38 = null;
     if (stream.Flags[4])
     {
         throw new NotImplementedException();
     }
     stream.Write(count, count);
 }
Example #5
0
        public void LoadPrototypes(Stream stream)
        {
            ulong          num;
            PackedStream_2 m_ = new PackedStream_2(1, stream);

            m_.CheckResourceHeader(0x464e4950, 1, 1);
            m_.Read(out num);
            for (ulong i = 0L; i < num; i += (ulong)1L)
            {
                ulong num3;
                ulong num4;
                m_.Read(out num3);
                m_.Read(out num4);
                this.LoadPrototype(num3);
            }
            m_.CheckEnd();
        }
Example #6
0
 public DeserializeLookupList(PackedStream_2 stream, int valueState, HeroType defaultIndexerType)
     : base(stream, HeroTypes.LookupList)
 {
     this.valueType = defaultIndexerType;
     this.m_30      = false;
     if (stream.Flags[4])
     {
         if (this.Next == null)
         {
             throw new InvalidDataException("Only a HeroClass can be the root container type");
         }
         else
         {
             throw new NotImplementedException();
         }
     }
     else
     {
         if (valueState != 1)
         {
             throw new InvalidDataException("Invalid value state");
         }
         if (stream.Flags[0])
         {
             ulong num;
             stream.Read(out num);
             if ((long)num != 0L)
             {
                 this.indexerType = new HeroType((HeroTypes)num);
             }
         }
         if (!this.GetValueType(ref this.valueType))
         {
             throw new InvalidDataException("Error getting type");
         }
         stream.Read(out this.m_0C, out this.Count);
         if (stream.Style != 8 && stream.Style != 10)
         {
             return;
         }
         this.m_30 = ((int)this.Count & 1) == 1;
         DeserializeLookupList deserializeLookupList = this;
         int num1 = (int)(deserializeLookupList.Count >> 1);
         deserializeLookupList.Count = (uint)num1;
     }
 }
Example #7
0
        public void LoadPrototypes(Stream stream)
        {
            PackedStream_2 packedStream2 = new PackedStream_2(1, stream);

            packedStream2.CheckResourceHeader(1179535696U, (ushort)1, (ushort)1);
            ulong num1;

            packedStream2.Read(out num1);
            for (ulong index = 0UL; index < num1; ++index)
            {
                ulong id;
                packedStream2.Read(out id);
                ulong num2;
                packedStream2.Read(out num2);
                this.LoadPrototype(id);
            }
            packedStream2.CheckEnd();
        }
Example #8
0
 public SerializeLookupList(PackedStream_2 stream, int valueState, HeroType type, int Count) : base(stream, HeroTypes.LookupList)
 {
     this.m_30 = false;
     if (stream.Flags[4])
     {
         throw new NotImplementedException();
     }
     if (stream.Flags[0])
     {
         stream.Write((ulong)((long)type.Indexer.Type));
     }
     this.SetValueType(type.Values.Type);
     if ((stream.Style == 8) || (stream.Style == 10))
     {
         stream.Write(Count * 2, Count * 2);
     }
     else
     {
         stream.Write(Count, Count);
     }
 }
Example #9
0
 public SerializeList(PackedStream_2 stream, int valueState, HeroTypes listType, int Count) : base(stream, HeroTypes.List)
 {
     this.index = 0;
     if (stream.Flags[4])
     {
         throw new NotImplementedException();
     }
     if (stream.Flags[0])
     {
         ulong num = (ulong)((long)listType);
         stream.Write(num);
     }
     if ((stream.Style == 8) || (stream.Style == 10))
     {
         stream.Write(Count * 2, Count * 2);
     }
     else
     {
         stream.Write(Count, Count);
     }
 }
Example #10
0
 public DeserializeList(PackedStream_2 stream, int valueState)
     : base(stream, HeroTypes.List)
 {
     this.index = 0U;
     this.m_30  = false;
     if (stream.Flags[4])
     {
         if (this.Next == null)
         {
             throw new InvalidDataException("Only a HeroClass can be the root container type");
         }
         else
         {
             throw new NotImplementedException();
         }
     }
     else
     {
         if (valueState != 1)
         {
             throw new InvalidDataException("Invalid value state");
         }
         if (stream.Flags[0])
         {
             ulong num;
             stream.Read(out num);
             this.listType = (HeroTypes)num;
         }
         stream.Read(out this.m_0C, out this.Count);
         if (stream.Style != 8 && stream.Style != 10)
         {
             return;
         }
         this.m_30 = ((int)this.Count & 1) == 1;
         DeserializeList deserializeList = this;
         int             num1            = (int)(deserializeList.Count >> 1);
         deserializeList.Count = (uint)num1;
     }
 }