private int NumberOfVisibleAsteroids(Asteroid a) { return(this.asteroids.Where(b => !b.Equals(a) && this.IsClearLineOfSight(a, b)).Count()); }
private bool IsClearLineOfSight(Asteroid a, Asteroid b) { return(!this.asteroids.Exists(c => !c.Equals(a) && !c.Equals(b) && IsBetween(a, b, c))); }
public void Add(Asteroid asteroid) { this.asteroids.Add(asteroid); }