Esempio n. 1
0
        public bool Here(string item, IMonsterManager manager = null)
        {
            if (item.ToLower().Equals("dwarf"))
            {
                if (manager.Monsters.Any(d => (d.CurrentLocation != null) &&
                                         d.CurrentLocation.LocationId.Equals(CurrentLocation.LocationId) &&
                                         (d.Group == MonsterGroup.Dwarves)))
                {
                    return(true);
                }
            }

            if (CurrentLocation.Items.Any(i => i.IsMatch(item)))
            {
                return(true);
            }

            return(CurrentLocation.Items.FirstOrDefault(i => i.Contents.Any(i => i.IsMatch(item)))
                   != null);
        }
Esempio n. 2
0
        public bool Here(Item item, IMonsterManager manager = null)
        {
            if (item == Item.Dwarf)
            {
                if (manager.Monsters.Any(d => (d.CurrentLocation != null) &&
                                         d.CurrentLocation.LocationId.Equals(CurrentLocation.LocationId) &&
                                         (d.Group == MonsterGroup.Dwarves)))
                {
                    return(true);
                }
            }

            if (CurrentLocation.Items.Any(x => x.ItemId == item))
            {
                return(true);
            }

            return(CurrentLocation.Items.FirstOrDefault(i => i.Contents.Any(i => i.ItemId == item))
                   != null);
        }