mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-25 04:15:45 -08:00
14 lines
281 B
C#
14 lines
281 B
C#
namespace Mugwump;
|
|
|
|
internal struct Distance
|
|
{
|
|
private readonly float _value;
|
|
|
|
public Distance(float deltaX, float deltaY)
|
|
{
|
|
_value = (float)Math.Sqrt(deltaX * deltaX + deltaY * deltaY);
|
|
}
|
|
|
|
public override string ToString() => _value.ToString("0.0");
|
|
}
|