Exemplo n.º 1
0
        /// <summary>
        /// Moves the in axial coordinates.
        /// </summary>
        /// <param name="coordinates">The coordinates.</param>
        /// <param name="direction">The direction.</param>
        /// <returns></returns>
        public AxisCoordinate MoveInAxialCoordinates(AxisCoordinate coordinates, int direction)
        {
            Dictionary <int, int[]> neighbors = new Dictionary <int, int[]>
            {
                { 0, new int[] { 1, 0 } }, { 1, new int[] { 1, -1 } }, { 2, new int[] { 0, -1 } },
                { 3, new int[] { -1, 0 } }, { 4, new int[] { -1, 1 } }, { 5, new int[] { 0, 1 } }
            };

            int[] d = neighbors[direction];

            return(new AxisCoordinate(coordinates.Q + d[0], coordinates.R + d[1]));
        }
Exemplo n.º 2
0
 public static float CalculateAxialCoordDistance(AxisCoordinate axis1, AxisCoordinate axis2)
 {
     return(1);
 }