示例#1
0
        public void AxialToOffset(int q, int r, int expectedX, int expectedY)
        {
            var axial  = new AxialCoord(q, r);
            var offset = axial.ToOffset();

            Assert.AreEqual(expectedX, offset.X);
            Assert.AreEqual(expectedY, offset.Y);
        }
示例#2
0
        public void ReadWriteByCoord()
        {
            var axial = new AxialCoord(-1, +2);
            var map   = new HexTileMap <int>(5, 5);

            int expectedValue = 3;

            map[axial] = expectedValue;

            Assert.AreEqual(expectedValue, map[axial]);
            Assert.AreEqual(expectedValue, map[axial.ToOffset()]);
            Assert.AreEqual(expectedValue, map[axial.ToCube()]);
        }