コード例 #1
0
ファイル: GaryRoom.cs プロジェクト: ifeelrobbed/ServUO
        private GaryTheDungeonMaster GetGary()
        {
            if (Gary == null || Gary.Deleted)
            {
                GaryTheDungeonMaster gary  = null;
                IPooledEnumerable    eable = Map.GetMobilesInBounds(_Bounds[0]);

                foreach (Mobile m in eable)
                {
                    if (m is GaryTheDungeonMaster)
                    {
                        gary = (GaryTheDungeonMaster)m;
                        break;
                    }
                }

                eable.Free();

                if (gary != null)
                {
                    Gary = gary;
                    Gary.MoveToWorld(_GaryLoc, Map.Malas);
                }
                else
                {
                    Gary = new GaryTheDungeonMaster();
                    Gary.MoveToWorld(_GaryLoc, Map.Malas);
                }
            }

            return(Gary);
        }
コード例 #2
0
        private GaryTheDungeonMaster GetGary()
        {
            if (Gary == null || Gary.Deleted)
            {
                GaryTheDungeonMaster gary = this.GetEnumeratedMobiles().OfType <GaryTheDungeonMaster>().FirstOrDefault(m => m is GaryTheDungeonMaster && !m.Deleted);

                if (gary != null)
                {
                    Gary = gary;
                    Gary.MoveToWorld(_GaryLoc, Map.Malas);
                }
                else
                {
                    Gary = new GaryTheDungeonMaster();
                    Gary.MoveToWorld(_GaryLoc, Map.Malas);
                }
            }

            return(Gary);
        }