public List <string> CreateArray(RelayInfo info, Mobile from)
        {
            List <string> itemsName = new List <string>();

            for (int i = 0; i < 13; i++)
            {
                TextRelay te = info.GetTextEntry(i);

                if (te != null)
                {
                    string str = te.Text;

                    if (str.Length > 0)
                    {
                        str = str.Trim();

                        Type type = ItemSpawnerType.GetType(str);


                        if (type != null)
                        {
                            itemsName.Add(str);
                        }
                        else
                        {
                            from.SendMessage("{0} is not a valid type name.", str);
                        }
                    }
                }
            }

            return(itemsName);
        }
Beispiel #2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            m_MinDelay = reader.ReadTimeSpan();
            m_MaxDelay = reader.ReadTimeSpan();
            m_Count    = reader.ReadInt();
            m_Running  = reader.ReadBool();

            if (m_Running)
            {
                TimeSpan delay = reader.ReadTimeSpan();
                DoTimer(delay);
            }

            int size = reader.ReadInt();

            m_ItemsName = new List <string>(size);

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

                m_ItemsName.Add(typeName);

                if (ItemSpawnerType.GetType(typeName) == null)
                {
                    if (m_WarnTimer == null)
                    {
                        m_WarnTimer = new WarnTimer();
                    }

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

            int count = reader.ReadInt();

            m_Items = new ArrayList(count);

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

                if (e != null)
                {
                    m_Items.Add(e);
                }
            }
        }