示例#1
0
        public override void Deserialize(PackedStream_2 stream)
        {
            base.hasValue = true;
            this.Data     = new List <HeroVarId>();
            DeserializeList list = new DeserializeList(stream, 1);

            if (base.Type.Values == null)
            {
                base.Type.SetValuesType(list.listType);
            }
            for (uint i = 0; i < list.Count; i++)
            {
                uint num2;
                bool flag;
                int  num3;
                list.GetFieldIndex(out num2, out flag, out num3);
                HeroAnyValue value2 = HeroAnyValue.Create(base.Type.Values);
                value2.Deserialize(stream);
                this.Data.Add(new HeroVarId(num3, value2));
                if (num3 > this.nextId)
                {
                    this.nextId = num3;
                }
            }
        }
示例#2
0
        public override void Deserialize(PackedStream_2 stream)
        {
            this.hasValue = true;
            this.Data     = new List <HeroVarId>();
            DeserializeList deserializeList = new DeserializeList(stream, 1);

            if (this.Type.Values == null)
            {
                this.Type.SetValuesType(deserializeList.listType);
            }
            for (uint index1 = 0U; index1 < deserializeList.Count; ++index1)
            {
                uint index2;
                bool b;
                int  variableId;
                deserializeList.GetFieldIndex(out index2, out b, out variableId);
                HeroAnyValue heroAnyValue = HeroAnyValue.Create(this.Type.Values);
                heroAnyValue.Deserialize(stream);
                this.Data.Add(new HeroVarId(variableId, heroAnyValue));
                if (variableId > this.nextId)
                {
                    this.nextId = variableId;
                }
            }
        }
示例#3
0
        public override void Deserialize(PackedStream_2 stream)
        {
            base.hasValue = true;
            this.Data     = new Dictionary <HeroVarId, HeroAnyValue>();
            HeroType defaultIndexerType = new HeroType(HeroTypes.None);

            if (base.Type.Indexer != null)
            {
                defaultIndexerType = base.Type.Indexer;
            }
            DeserializeLookupList list = new DeserializeLookupList(stream, 1, defaultIndexerType);

            if ((base.Type.Indexer == null) || (base.Type.Indexer.Type == HeroTypes.None))
            {
                base.Type.Indexer = list.indexerType;
            }
            else
            {
                list.indexerType = base.Type.Indexer;
            }
            if (base.Type.Values == null)
            {
                base.Type.Values = list.valueType;
            }
            else
            {
                list.valueType = base.Type.Values;
            }
            for (ulong i = 0L; i < list.Count; i += (ulong)1L)
            {
                int          num2;
                HeroAnyValue value2;
                list.GetKey(out value2, out num2);
                HeroAnyValue value3 = HeroAnyValue.Create(base.Type.Values);
                value3.Deserialize(stream);
                this.Data[new HeroVarId(num2, value2)] = value3;
                if (num2 > this.nextId)
                {
                    this.nextId = num2;
                }
            }
        }
示例#4
0
        public override void Deserialize(PackedStream_2 stream)
        {
            this.hasValue = true;
            this.Data     = new Dictionary <HeroVarId, HeroAnyValue>();
            HeroType defaultIndexerType = new HeroType(HeroTypes.None);

            if (this.Type.Indexer != null)
            {
                defaultIndexerType = this.Type.Indexer;
            }
            DeserializeLookupList deserializeLookupList = new DeserializeLookupList(stream, 1, defaultIndexerType);

            if (this.Type.Indexer == null || this.Type.Indexer.Type == HeroTypes.None)
            {
                this.Type.Indexer = deserializeLookupList.indexerType;
            }
            else
            {
                deserializeLookupList.indexerType = this.Type.Indexer;
            }
            if (this.Type.Values == null)
            {
                this.Type.Values = deserializeLookupList.valueType;
            }
            else
            {
                deserializeLookupList.valueType = this.Type.Values;
            }
            for (ulong index = 0UL; index < (ulong)deserializeLookupList.Count; ++index)
            {
                HeroAnyValue key;
                int          variableId;
                deserializeLookupList.GetKey(out key, out variableId);
                HeroAnyValue heroAnyValue = HeroAnyValue.Create(this.Type.Values);
                heroAnyValue.Deserialize(stream);
                this.Data[new HeroVarId(variableId, key)] = heroAnyValue;
                if (variableId > this.nextId)
                {
                    this.nextId = variableId;
                }
            }
        }
示例#5
0
        public override void Deserialize(PackedStream_2 stream)
        {
            this.hasValue  = true;
            this.Variables = new VariableList();
            DeserializeClass deserializeClass = new DeserializeClass(stream, 1);

            for (uint index = 0U; index < deserializeClass.Count; ++index)
            {
                uint  type1      = 0U;
                int   variableId = 0;
                ulong fieldId;
                int   d;
                deserializeClass.ReadFieldData(out fieldId, ref type1, ref variableId, out d);
                if (d != 2)
                {
                    HeroType     type2 = new HeroType((HeroTypes)type1);
                    DefinitionId field = new DefinitionId(fieldId);
                    if (field.Definition != null)
                    {
                        HeroFieldDef heroFieldDef = field.Definition as HeroFieldDef;
                        switch (heroFieldDef.FieldType.Type)
                        {
                        case HeroTypes.Enum:
                        case HeroTypes.ScriptRef:
                            type2.Id = heroFieldDef.FieldType.Id;
                            break;

                        case HeroTypes.LookupList:
                            type2 = heroFieldDef.FieldType;
                            break;
                        }
                    }
                    HeroAnyValue heroAnyValue = HeroAnyValue.Create(type2);
                    heroAnyValue.Deserialize(stream);
                    this.Variables.Add(new Variable(field, variableId, heroAnyValue));
                }
            }
        }