public void AxisAlignedList() { Hex[] hexes1 = { new Hex(0, 0, 0), new Hex(-1, 0, 1), new Hex(-4, 0, 4), new Hex(5, 0, -5), }; Assert.IsTrue(Hex.AxisAligned(hexes1, Position.topright)); Hex[] hexes2 = { new Hex(0, 0, 0), new Hex(-1, 0, 1), new Hex(0, 1, -1), new Hex(-4, 0, 4), new Hex(5, 0, -5), }; Assert.IsFalse(Hex.AxisAligned(hexes2, Position.topright)); Hex[] hexes3 = { new Hex(-3, 2, 1), new Hex(-3, 5, -2), new Hex(-3, 0, 3), new Hex(-2, -3, 5), }; Assert.IsFalse(Hex.AxisAligned(hexes3, Position.bottomright)); }
public void AxisAligned() { Hex to = new Hex(2, 0, -2); Hex from = new Hex(-1, -3, 4); Assert.IsFalse(Hex.AxisAligned(from, to)); Hex to2 = new Hex(3, -3, 0); Hex from2 = new Hex(-1, -3, 4); Assert.IsTrue(Hex.AxisAligned(from2, to2)); }