Ejemplo n.º 1
0
        public void AngleToIndex()
        {
            Assert.AreEqual(0, hexagonOnEdge.AngleToIndex(-90.0));
            Assert.AreEqual(1, hexagonOnEdge.AngleToIndex(-30.0));
            Assert.AreEqual(2, hexagonOnEdge.AngleToIndex(30.0));
            Assert.AreEqual(3, hexagonOnEdge.AngleToIndex(90.0));
            Assert.AreEqual(4, hexagonOnEdge.AngleToIndex(150.0));
            Assert.AreEqual(5, hexagonOnEdge.AngleToIndex(210.0));

            Assert.AreEqual(0, hexagonOnVertex.AngleToIndex(-60.0));
            Assert.AreEqual(1, hexagonOnVertex.AngleToIndex(0.0));
            Assert.AreEqual(2, hexagonOnVertex.AngleToIndex(60.0));
            Assert.AreEqual(3, hexagonOnVertex.AngleToIndex(120.0));
            Assert.AreEqual(4, hexagonOnVertex.AngleToIndex(180.0));
            Assert.AreEqual(5, hexagonOnVertex.AngleToIndex(240.0));

            Assert.AreEqual(1, squareOnEdge.AngleToIndex(-23.0));
            Assert.AreEqual(2, squareOnEdge.AngleToIndex(-22.0));
            Assert.AreEqual(3, squareOnEdge.AngleToIndex(67.0));
            Assert.AreEqual(4, squareOnEdge.AngleToIndex(68.0));
            Assert.AreEqual(5, squareOnEdge.AngleToIndex(157.0));
            Assert.AreEqual(6, squareOnEdge.AngleToIndex(158.0));
            Assert.AreEqual(7, squareOnEdge.AngleToIndex(247.0));
            Assert.AreEqual(0, squareOnEdge.AngleToIndex(248.0));
        }