Server.Mobiles.IntelliSpawner.Deserialize C# (CSharp) Méthode

Deserialize() public méthode

public Deserialize ( GenericReader reader ) : void
reader GenericReader
Résultat void
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 6:
                    {
                        MobilesSeekHome = reader.ReadBool();
                        UsesSpawnerHome = reader.ReadBool();
                        goto
                        case 5;
                    }
                case 5:
                    {
                        SpawnArea = reader.ReadRect2D();
                        UsesSpawnerHome = reader.ReadBool();

                        goto
                        case 4;
                    }
                case 4:
                    {
                        m_WalkingRange = reader.ReadInt();

                        goto
                        case 3;
                    }
                case 3:
                case 2:
                    {
                        WayPoint = reader.ReadItem() as WayPoint;

                        goto
                        case 1;
                    }

                case 1:
                    {
                        m_Group = reader.ReadBool();

                        goto
                        case 0;
                    }

                case 0:
                    {
                        m_MinDelay = reader.ReadTimeSpan();
                        m_MaxDelay = reader.ReadTimeSpan();
                        m_Count = reader.ReadInt();
                        m_Team = reader.ReadInt();
                        m_HomeRange = reader.ReadInt();
                        m_Running = reader.ReadBool();

                        if (m_Running)
                            reader.ReadDeltaTime();

                        int size = reader.ReadInt();

                        m_SpawnNames = new List < string >(size);

                        for (int i = 0; i < size; ++i)
                        {
                            string creatureString = reader.ReadString();

                            m_SpawnNames.Add(creatureString);
                            string typeName = ParseType(creatureString);

                            if (ScriptCompiler.FindTypeByName(typeName) == null)
                            {
                                if (m_WarnTimer == null)
                                    m_WarnTimer = new WarnTimer();

                                m_WarnTimer.Add(Location, Map, typeName);
                            }
                        }

                        int count = reader.ReadInt();

                        m_Spawned = new List < ISpawnable >(count);

                        for (int i = 0; i < count; ++i)
                        {
                            var e = World.FindEntity(reader.ReadInt()) as ISpawnable;

                            if (e != null)
                            {
                                e.Spawner = this;
                                m_Spawned.Add(e);
                            }
                        }

                        if (m_Running)
                        {
                            RemoveSpawned();
                            m_Running = false;
                        }

                        break;
                    }
            }

            if (version < 3 && Math.Abs(Weight) < 1)
                Weight = -1;
        }