2022-02-18 22:52:15 +00:00
|
|
|
using MultiversalDiplomacy.Adjudicate;
|
2022-03-13 07:15:26 +00:00
|
|
|
using MultiversalDiplomacy.Model;
|
2022-02-18 22:52:15 +00:00
|
|
|
using MultiversalDiplomacy.Orders;
|
|
|
|
|
|
|
|
namespace MultiversalDiplomacyTests;
|
|
|
|
|
|
|
|
public class TestAdjudicator : IPhaseAdjudicator
|
|
|
|
{
|
2022-03-23 03:13:49 +00:00
|
|
|
public static Func<World, List<Order>, List<OrderValidation>> RubberStamp =
|
|
|
|
(world, orders) => orders.Select(o => o.Validate(ValidationReason.Valid)).ToList();
|
|
|
|
|
2022-03-13 07:15:26 +00:00
|
|
|
private Func<World, List<Order>, List<OrderValidation>> ValidateOrdersCallback;
|
2022-02-18 22:52:15 +00:00
|
|
|
|
|
|
|
public TestAdjudicator(
|
2022-03-13 07:15:26 +00:00
|
|
|
Func<World, List<Order>, List<OrderValidation>> validateOrdersCallback)
|
2022-02-18 22:52:15 +00:00
|
|
|
{
|
|
|
|
this.ValidateOrdersCallback = validateOrdersCallback;
|
|
|
|
}
|
|
|
|
|
2022-03-13 07:15:26 +00:00
|
|
|
public List<OrderValidation> ValidateOrders(World world, List<Order> orders)
|
|
|
|
=> this.ValidateOrdersCallback.Invoke(world, orders);
|
2022-03-24 15:12:11 +00:00
|
|
|
|
|
|
|
public (List<OrderAdjudication> results, World updated) AdjudicateOrders(
|
|
|
|
World world,
|
|
|
|
List<Order> orders)
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
2022-02-18 22:52:15 +00:00
|
|
|
}
|