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(double 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 double Coordinate = Coordinate; /// /// get the coordinate but calculated by the extents of the wall size. /// public double ByWallSizeExtents => Coordinate - Constants.WallSizeExtents; /// /// get the coordinate but calculated by the wall size. /// public double ByWallSize => Coordinate - Constants.WallSize; public static implicit operator double(GameCoordinate coord) => coord.Coordinate; }