public static CubicCoordinates FromOffset(OffsetCoordinates offset) { var x = offset.Col - (offset.Row - (offset.Row & 1)) / 2; var z = offset.Row; var y = -1 * (x + z); return(new CubicCoordinates(x: x, y: y, z: z)); }
public OffsetCoordinates ToOffset() => OffsetCoordinates.FromAxial(this);
public static AxialCoordinates FromOffset(OffsetCoordinates offset) => AxialCoordinates.FromCubic( CubicCoordinates.FromOffset(offset) );
public static OffsetCoordinates FromCubic(CubicCoordinates cubic) => OffsetCoordinates.FromAxial( AxialCoordinates.FromCubic(cubic) );
public OffsetCoordinates ToOffset() => OffsetCoordinates.FromCubic(this);
public bool EqualsOffset(OffsetCoordinates offset) => CubicCoordinates .FromOffset(offset) .Equals(this);