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