IEnumerable <Actor> SelectActorsInBox(World world, PPos a, PPos b, Func <Actor, bool> cond) { return(world.FindActorsInBox(a.ToWPos(0), b.ToWPos(0)) .Where(x => x.HasTrait <Selectable>() && x.Trait <Selectable>().Info.Selectable&& !world.FogObscures(x) && cond(x)) .GroupBy(x => x.GetSelectionPriority()) .OrderByDescending(g => g.Key) .Select(g => g.AsEnumerable()) .DefaultIfEmpty(NoActors) .FirstOrDefault()); }
IEnumerable<Actor> SelectActorsInBox(World world, PPos a, PPos b, Func<Actor, bool> cond) { return world.FindActorsInBox(a.ToWPos(0), b.ToWPos(0)) .Where(x => x.HasTrait<Selectable>() && x.Trait<Selectable>().Info.Selectable && !world.FogObscures(x) && cond(x)) .GroupBy(x => x.GetSelectionPriority()) .OrderByDescending(g => g.Key) .Select(g => g.AsEnumerable()) .DefaultIfEmpty(NoActors) .FirstOrDefault(); }