public void DistanceTo() { CubicHexCoord cubic1 = new CubicHexCoord(0, 0, 0); CubicHexCoord cubic2 = cubic1.Neighbor(DirectionEnum.E).Neighbor(DirectionEnum.SE); int distance = cubic1.DistanceTo(cubic2); Assert.That(distance, Is.EqualTo(2)); }
public void Neighbors() { CubicHexCoord cubic = new CubicHexCoord(1, 2, 3); CubicHexCoord[] neighbors = cubic.Neighbors(); Assert.That(neighbors, Is.EquivalentTo(new CubicHexCoord[6] { cubic.Neighbor(DirectionEnum.E), cubic.Neighbor(DirectionEnum.SE), cubic.Neighbor(DirectionEnum.SW), cubic.Neighbor(DirectionEnum.W), cubic.Neighbor(DirectionEnum.NW), cubic.Neighbor(DirectionEnum.NE) })); }