public void AxialToCubeTest(int q, int r, int expectedX, int expectedY, int expectedZ) { var axial = new AxialCoord(q, r); var cube = axial.ToCube(); Assert.AreEqual(expectedX, cube.X); Assert.AreEqual(expectedY, cube.Y); Assert.AreEqual(expectedZ, cube.Z); }
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()]); }