示例#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);
 }