Beispiel #1
0
 public static int Distance(Hex a, Hex b)
 {
     return(Length(a - b));
 }
Beispiel #2
0
        public static Hex Neighbour(Hex a, int direction)
        {
            direction %= directions.Length;

            return(a + directions[direction]);
        }
Beispiel #3
0
 public static int Length(Hex a)
 {
     return((Math.Abs(a.Q) + Math.Abs(a.R) + Math.Abs(a.S)) / 2);
 }