namespace Pong.Scripts.Data; /// /// simple wrapper structure to a double that makes it easy to get commonly used calculations of the number. /// /// the coordinate you want to wrap. public readonly record struct GameCoordinate(float Coordinate) { /// /// the original coordinate. you don't really need to use this as the struct has an implicit operator, but /// its here if you need it. /// public readonly float Coordinate = Coordinate; /// /// get the coordinate but calculated by the extents of the wall size. /// public float ByWallSizeExtents => Coordinate - Constants.WallSizeExtents; /// /// get the coordinate but calculated by the wall size. /// public float ByWallSize => Coordinate - Constants.WallSize; public static implicit operator float(GameCoordinate coord) => coord.Coordinate; }