Beispiel #1
0
        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));
        }
Beispiel #2
0
 public OffsetCoordinates ToOffset() => OffsetCoordinates.FromAxial(this);
Beispiel #3
0
 public static AxialCoordinates FromOffset(OffsetCoordinates offset) =>
 AxialCoordinates.FromCubic(
     CubicCoordinates.FromOffset(offset)
     );
Beispiel #4
0
 public static OffsetCoordinates FromCubic(CubicCoordinates cubic) =>
 OffsetCoordinates.FromAxial(
     AxialCoordinates.FromCubic(cubic)
     );
Beispiel #5
0
 public OffsetCoordinates ToOffset() => OffsetCoordinates.FromCubic(this);
Beispiel #6
0
 public bool EqualsOffset(OffsetCoordinates offset) =>
 CubicCoordinates
 .FromOffset(offset)
 .Equals(this);