Esempio n. 1
0
 public DeserializeClass(PackedStream2 stream, int valueState)
     : base(stream, HeroTypes.Class)
 {
     m_28 = 0UL;
     m_30 = m_34 = 0;
     m_38 = null;
     if (stream.Flags[4])
     {
         if (valueState == 0)
         {
             return;
         }
         if (valueState != 1)
         {
             throw new InvalidDataException("Invalid value state");
         }
         if (Next != null)
         {
             throw new NotImplementedException();
         }
         ulong num;
         Stream.Read(out num);
         throw new NotImplementedException();
     }
     else
     {
         if (valueState != 1)
         {
             throw new InvalidDataException("Invalid value state");
         }
         stream.Read(out m_0C, out Count);
     }
 }
Esempio n. 2
0
 public SerializeStateBase(PackedStream2 stream, HeroTypes heroType)
 {
     HeroType     = heroType;
     Next         = null;
     Stream       = stream;
     m_0C         = 0U;
     Count        = 0U;
     Next         = stream.State;
     stream.State = this;
 }
Esempio n. 3
0
 public SerializeClass(PackedStream2 stream, int valueState, int count)
     : base(stream, HeroTypes.Class)
 {
     m_28 = 0UL;
     m_30 = m_34 = 0;
     m_38 = null;
     if (stream.Flags[4])
     {
         throw new NotImplementedException();
     }
     stream.Write(count, count);
 }
Esempio n. 4
0
 public DeserializeLookupList(PackedStream2 stream, int valueState, HeroType defaultIndexerType)
     : base(stream, HeroTypes.LookupList)
 {
     valueType = defaultIndexerType;
     m_30      = false;
     if (stream.Flags[4])
     {
         if (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)
             {
                 indexerType = new HeroType((HeroTypes)num);
             }
         }
         if (!GetValueType(ref valueType))
         {
             throw new InvalidDataException("Error getting type");
         }
         stream.Read(out m_0C, out Count);
         if (stream.Style != 8 && stream.Style != 10)
         {
             return;
         }
         m_30 = ((int)Count & 1) == 1;
         DeserializeLookupList deserializeLookupList = this;
         var num1 = (int)(deserializeLookupList.Count >> 1);
         deserializeLookupList.Count = (uint)num1;
     }
 }
Esempio n. 5
0
        public void LoadPrototypes(Stream stream)
        {
            var packedStream2 = new PackedStream2(1, stream);

            packedStream2.CheckResourceHeader(1179535696U, 1, 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);
                LoadPrototype(id);
            }
            packedStream2.CheckEnd();
        }
Esempio n. 6
0
 public SerializeList(PackedStream2 stream, int valueState, HeroTypes listType, int Count)
     : base(stream, HeroTypes.List)
 {
     index = 0;
     if (stream.Flags[4])
     {
         throw new NotImplementedException();
     }
     if (stream.Flags[0])
     {
         var num = (ulong)listType;
         stream.Write(num);
     }
     if (stream.Style == 8 || stream.Style == 10)
     {
         stream.Write(Count * 2, Count * 2);
     }
     else
     {
         stream.Write(Count, Count);
     }
 }
Esempio n. 7
0
 public SerializeLookupList(PackedStream2 stream, int valueState, HeroType type, int Count)
     : base(stream, HeroTypes.LookupList)
 {
     m_30 = false;
     if (stream.Flags[4])
     {
         throw new NotImplementedException();
     }
     if (stream.Flags[0])
     {
         stream.Write((ulong)type.Indexer.Type);
     }
     SetValueType(type.Values.Type);
     if (stream.Style == 8 || stream.Style == 10)
     {
         stream.Write(Count * 2, Count * 2);
     }
     else
     {
         stream.Write(Count, Count);
     }
 }
Esempio n. 8
0
        public DeserializeList(PackedStream2 stream, int valueState)
            : base(stream, HeroTypes.List)
        {
            Index = 0U;
            M30   = false;
            if (stream.Flags[4])
            {
                if (Next == null)
                {
                    throw new InvalidDataException("Only a HeroClass can be the root container type");
                }
            }
            else
            {
                if (valueState != 1)
                {
                    throw new InvalidDataException("Invalid value state");
                }

                if (stream.Flags[0])
                {
                    UInt64 num;
                    stream.Read(out num);
                    ListType = (HeroTypes)num;
                }
            }

            stream.Read(out m_0C, out Count);
            if (stream.Style != 8 && stream.Style != 10)
            {
                return;
            }

            M30     = (Count & 1) == 1;
            Count >>= 1;
        }