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