Пример #1
0
        public void IndexToCompass()
        {
            Assert.AreEqual(Compass.SouthEast, hexagonOnEdge.IndexToCompass(2));
            Assert.AreEqual(Compass.South, hexagonOnEdge.IndexToCompass(3));
            Assert.AreEqual(Compass.SouthWest, hexagonOnEdge.IndexToCompass(4));
            Assert.AreEqual(Compass.NorthWest, hexagonOnEdge.IndexToCompass(5));
            Assert.AreEqual(Compass.North, hexagonOnEdge.IndexToCompass(6));
            Assert.AreEqual(Compass.NorthEast, hexagonOnEdge.IndexToCompass(7));

            Assert.AreEqual(Compass.SouthEast, hexagonOnVertex.IndexToCompass(2));
            Assert.AreEqual(Compass.SouthWest, hexagonOnVertex.IndexToCompass(3));
            Assert.AreEqual(Compass.West, hexagonOnVertex.IndexToCompass(4));
            Assert.AreEqual(Compass.NorthWest, hexagonOnVertex.IndexToCompass(5));
            Assert.AreEqual(Compass.NorthEast, hexagonOnVertex.IndexToCompass(6));
            Assert.AreEqual(Compass.East, hexagonOnVertex.IndexToCompass(7));

            Assert.AreEqual(Compass.East, squareOnEdge.IndexToCompass(2));
            Assert.AreEqual(Compass.SouthEast, squareOnEdge.IndexToCompass(3));
            Assert.AreEqual(Compass.South, squareOnEdge.IndexToCompass(4));
            Assert.AreEqual(Compass.SouthWest, squareOnEdge.IndexToCompass(-3));
            Assert.AreEqual(Compass.West, squareOnEdge.IndexToCompass(-2));
            Assert.AreEqual(Compass.NorthWest, squareOnEdge.IndexToCompass(-1));
            Assert.AreEqual(Compass.North, squareOnEdge.IndexToCompass(0));
            Assert.AreEqual(Compass.NorthEast, squareOnEdge.IndexToCompass(1));
        }