コード例 #1
0
        public void TestNeighbours()
        {
            var v1 = new CubeCoordinates(0, 0, 0);
            var v2 = v1.Neighbor((CoordinateDirectionFlat)1);
            var v3 = v1.Neighbor((CoordinateDirectionPointy)1);

            Assert.AreEqual(v2, v3);
            Assert.AreEqual(CubeCoordinates.Direction(1), v2);
            var v4 = v1.DiagonalNeighbor((CoordinateDirectionFlatDiagonal)1);
            var v5 = v1.DiagonalNeighbor((CoordinateDirectionPointyDiagonal)1);

            Assert.AreEqual(CubeCoordinates.Diagonals(1), v4);
            Assert.AreEqual(v4, v5);
        }
コード例 #2
0
ファイル: HexTest.cs プロジェクト: clawfoot-software/HexGrid
 public void TestHexNeighbor()
 {
     EqualHex("hex_neighbor", new CubeCoordinates(1, -3, 2), CubeCoordinates.Neighbor(new CubeCoordinates(1, -2, 1), 2));
 }