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