public void EnsureHorizontalAndVerticalMovementCostFunctionsCorrectly() { var world = new World <bool>(2, 1, true); var costCalculator = new BooleanMapCostCalculator(world); costCalculator.HorizontalAndVerticalMovementCost = 10; Assert.AreEqual(10, costCalculator.CalculateCost(0, 0, 1, 0, 1, 0)); Assert.AreEqual(10, costCalculator.CalculateCost(0, 0, -1, 0, -1, 0)); Assert.AreEqual(10, costCalculator.CalculateCost(0, 0, 0, 1, 0, 1)); Assert.AreEqual(10, costCalculator.CalculateCost(0, 0, 0, -1, 0, -1)); }
public void EnsureDiagonalMovementCostFunctionsCorrectly() { var world = new World <bool>(2, 2, true); var costCalculator = new BooleanMapCostCalculator(world); costCalculator.DiagonalMovementCost = 14; Assert.AreEqual(14, costCalculator.CalculateCost(0, 0, 1, 1, 1, 1)); Assert.AreEqual(14, costCalculator.CalculateCost(0, 0, 1, -1, 1, -1)); Assert.AreEqual(14, costCalculator.CalculateCost(0, 0, -1, 1, -1, 1)); Assert.AreEqual(14, costCalculator.CalculateCost(0, 0, -1, -1, -1, -1)); }