Add C# implementaion of 86 Target

This commit is contained in:
Andrew Cooper
2021-10-04 17:45:55 +11:00
parent 78154bc36e
commit 39ba532739
12 changed files with 399 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
namespace Target
{
internal class Explosion
{
private readonly Point _position;
public Explosion(Point position, Offset targetOffset)
{
_position = position;
FromTarget = targetOffset;
DistanceToTarget = targetOffset.Distance;
}
public Point Position => _position;
public Offset FromTarget { get; }
public float DistanceToTarget { get; }
public string GetBearing() => _position.GetBearing();
public bool IsHit => DistanceToTarget <= 20;
public bool IsTooClose => _position.Distance < 20;
}
}