Files
basic-computer-games/86_Target/csharp/Explosion.cs
2022-01-17 11:59:02 +02:00

23 lines
623 B
C#

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;
}
}