Example #1
0
File: Hex.cs Project: GPMM/EcoLab
 public static int Distance(Hex a, Hex b)
 {
     return(Length(a - b));
 }
Example #2
0
File: Hex.cs Project: GPMM/EcoLab
        public static Hex Neighbour(Hex a, int direction)
        {
            direction %= directions.Length;

            return(a + directions[direction]);
        }
Example #3
0
File: Hex.cs Project: GPMM/EcoLab
 public static int Length(Hex a)
 {
     return((Math.Abs(a.Q) + Math.Abs(a.R) + Math.Abs(a.S)) / 2);
 }