예제 #1
0
        protected override bool OnDeSerialize(SimpleStream.SerializableDecoder decoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                ushort size = 0;

                m_vfxs.Clear();
                m_sfxs.Clear();
                m_statusEffects.Clear();
                m_blocks.Clear();
                m_skills.Clear();
                m_gameModes.Clear();
                m_projectiles.Clear();
                m_heroObjects.Clear();
                m_monsters.Clear();
                m_noticeObjects.Clear();
                m_warpGates.Clear();
                m_buffers.Clear();
                m_debuffers.Clear();
                m_lockObstacles.Clear();
                m_slotMachines.Clear(); 
                m_challengers.Clear();
                m_stageObjects.Clear();
                m_stages.Clear();
                m_consumableTypes.Clear();
                m_consumables.Clear();
                m_screenPositions.Clear();
                m_bufferActions.Clear();
                m_slotMachineReels.Clear();

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    VFX o = new VFX();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_vfxs.Add(o.VfxID, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    SFX o = new SFX();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_sfxs.Add(o.SfxID, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    StatusEffect o = new StatusEffect();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_statusEffects.Add(o.StatusEffectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    Block o = new Block();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_blocks.Add(o.BlockID, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    Skill o = new Skill();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_skills.Add(o.SkillCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    GameMode o = new GameMode();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_gameModes.Add(o.Mode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    Projectile o = new Projectile();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_projectiles.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    HeroObject o = new HeroObject();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_heroObjects.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    Monster o = new Monster();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_monsters.Add(o.FieldObjectCode, o);

                    o.SoType = StageObjectType.Monster;
                    m_stageObjects.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    NoticeObject o = new NoticeObject();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_noticeObjects.Add(o.FieldObjectCode, o);

                    o.SoType = StageObjectType.Notice;
                    m_stageObjects.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    WarpGate o = new WarpGate();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_warpGates.Add(o.FieldObjectCode, o);

                    o.SoType = StageObjectType.WarpGate;
                    m_stageObjects.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    Buffer o = new Buffer();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_buffers.Add(o.FieldObjectCode, o);

                    o.SoType = StageObjectType.Buffer;
                    m_stageObjects.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    DeBuffer o = new DeBuffer();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_debuffers.Add(o.FieldObjectCode, o);

                    o.SoType = StageObjectType.DeBuffer;
                    m_stageObjects.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    LockObstacle o = new LockObstacle();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_lockObstacles.Add(o.FieldObjectCode, o);

                    o.SoType = StageObjectType.Chest;
                    m_stageObjects.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    SlotMachine o = new SlotMachine();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_slotMachines.Add(o.FieldObjectCode, o);

                    o.SoType = StageObjectType.SlotMachine;
                    m_stageObjects.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    Challenger o = new Challenger();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_challengers.Add(o.FieldObjectCode, o);

                    o.SoType = StageObjectType.Challenger;
                    m_stageObjects.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    Stage o = new Stage();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_stages.Add(o.StageCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    ConsumableTypeInfo o = new ConsumableTypeInfo();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_consumableTypes.Add(o.ConsumableType, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    Consumable o = new Consumable();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_consumables.Add(o.ConsumableID, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    ScreenPosition o = new ScreenPosition();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_screenPositions.Add(o.LifeRate, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    BufferAction o = new BufferAction();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_bufferActions.Add(o.BufferActionID, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    SlotMachineReel o = new SlotMachineReel();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_slotMachineReels.Add(o.ReelID, o);
                }
            }
            catch (Exception)
            {
                m_vfxs.Clear();
                m_sfxs.Clear();
                m_statusEffects.Clear();
                m_blocks.Clear();
                m_skills.Clear();
                m_gameModes.Clear();
                m_projectiles.Clear();
                m_heroObjects.Clear();
                m_monsters.Clear();
                m_noticeObjects.Clear();
                m_warpGates.Clear();
                m_buffers.Clear();
                m_debuffers.Clear();
                m_lockObstacles.Clear();
                m_slotMachines.Clear(); 
                m_challengers.Clear();
                m_stageObjects.Clear();
                m_stages.Clear();
                m_consumableTypes.Clear();
                m_consumables.Clear();
                m_screenPositions.Clear();
                m_bufferActions.Clear();
                m_slotMachineReels.Clear();
                m_hash = 0;

                ret = false;
            }

            return ret;
        }