예제 #1
0
파일: Hex.cs 프로젝트: GPMM/EcoLab
 public static int Distance(Hex a, Hex b)
 {
     return(Length(a - b));
 }
예제 #2
0
파일: Hex.cs 프로젝트: GPMM/EcoLab
        public static Hex Neighbour(Hex a, int direction)
        {
            direction %= directions.Length;

            return(a + directions[direction]);
        }
예제 #3
0
파일: Hex.cs 프로젝트: GPMM/EcoLab
 public static int Length(Hex a)
 {
     return((Math.Abs(a.Q) + Math.Abs(a.R) + Math.Abs(a.S)) / 2);
 }