Пример #1
0
 bool IsBallCrossingTrajectory(BallLocation cell)
 {
     if (Hits.FirstOrDefault(aa => aa.X == cell.X && aa.Y == cell.Y) != null)
     {
         return(true);
     }
     return(false);
 }
Пример #2
0
        string OffsetHitsToGrid(List <Hit> hits)
        {
            Hits = Hits.OrderBy(h => h.Index).ThenBy(h => h.Skip).ToList();
            var low = Hits.FirstOrDefault().Index;

            var last = Hits.LastOrDefault();
            var high = last.Index;

            high += (last.Term?.Length ?? 1) * last.Skip;

            Hits = Hits.Select(h => new Hit(h.Term, (h.Index - low), h.Start, h.Skip)).ToList();
            low  = low - Start >= 0 ? low - Start : low;
            high = high >= Text.Length ? Text.Length - 1 : high;
            return(Range(Text, low, high));
        }