Find() public static method

public static Find ( string name ) : Server.Mobiles.EscortDestinationInfo
name string
return Server.Mobiles.EscortDestinationInfo
        public EDI GetDestination()
        {
            if (this.m_DestinationString == null && this.m_DeleteTimer == null)
            {
                this.m_DestinationString = this.PickRandomDestination();
            }

            if (this.m_Destination != null && this.m_Destination.Name == this.m_DestinationString)
            {
                return(this.m_Destination);
            }

            if (Map.Felucca.Regions.Count > 0)
            {
                return(this.m_Destination = EDI.Find(this.m_DestinationString));
            }

            return(this.m_Destination = null);
        }
        public EscortDestinationInfo GetDestination()
        {
            if (m_DestinationString == null && m_DeleteTimer == null)
            {
                m_DestinationString = PickRandomDestination();
            }

            if (m_Destination != null && m_Destination.Name == m_DestinationString)
            {
                return(m_Destination);
            }

            if (Map.Felucca.Regions.Count > 0)
            {
                return(m_Destination = EscortDestinationInfo.Find(m_DestinationString));
            }

            return(m_Destination = null);
        }
        public virtual string PickRandomDestination()
        {
            if (Map.Felucca.Regions.Count == 0 || this.Map == null || this.Map == Map.Internal || this.Location == Point3D.Zero)
            {
                return(null); // Not yet fully initialized
            }
            string[] possible = this.GetPossibleDestinations();
            string   picked   = null;

            while (picked == null)
            {
                picked = possible[Utility.Random(possible.Length)];
                EDI test = EDI.Find(picked);

                if (test != null && test.Contains(this.Location))
                {
                    picked = null;
                }
            }

            return(picked);
        }
Esempio n. 4
0
        public virtual string PickRandomDestination()
        {
            if (Map.Felucca.Regions.Count == 0 || Map == null || Map == Map.Internal || Location == Point3D.Zero)
            {
                return(null);
            }

            string[] possible = destinations;
            string   picked   = null;

            while (picked == null)
            {
                picked = possible[Utility.Random(possible.Length)];
                EDI test = EDI.Find(picked);

                if (test != null && test.Contains(Location))
                {
                    picked = null;
                }
            }

            return(picked);
        }