Пример #1
0
        public static bool HasType(Region r, Type t)
        {
            if (r == null)
                return false;

            if (t.IsSubclassOf(typeof(Mobile)))
            {
                foreach (Mobile m in r.GetEnumeratedMobiles())
                {
                    if (m.GetType() == t)
                        return true;
                }
            }
            else if (t.IsSubclassOf(typeof(Item)))
            {
                foreach (Item i in r.GetEnumeratedItems())
                {
                    if (i.GetType() == t)
                        return true;
                }
            }

            return false;
        }