using MultiversalDiplomacy.Orders;
using MultiversalDiplomacy.Model;
namespace MultiversalDiplomacy.Adjudicate;
///
/// An input handler for game phases.
///
public interface IPhaseAdjudicator
{
///
/// Given a list of order sets, determine which entries are comprehensible as orders.
/// An order set entry may comprehensible as an order but not valid for the current
/// phase; these orders will be rejected by .
///
/// The global game state.
/// The order sets to adjudicate.
///
/// A list of objects representing the orders parsed.
///
public List ParseOrderSets(World world, List orderSets);
///
/// Given a list of orders, determine which orders are valid for this adjudicator and
/// which should be rejected before adjudication. Adjudication should be performed on
/// all orders in the output for which is true.
///
/// The global game state.
/// Orders to validate for adjudication.
///
/// A list of order validation results. Note that this list may be longer than the input
/// list if illegal orders were replaced with hold orders, as there will be an invalid
/// result for the illegal order and a valid result for the replacement order.
///
public List ValidateOrders(World world, List orders);
///
/// Given a list of valid orders, adjudicate the success and failure of the orders. The kinds
/// of adjudication decisions returned depends on the phase adjudicator.
///
/// The global game state.
///
/// Orders to adjudicate. The order list should contain only valid orders, as validated by
/// , and should contain exactly one order for every unit able to
/// be ordered.
///
///
/// A list of adjudication decicions. The decision types will be specific to the phase
/// adjudicator and should be comprehensible to that adjudicator's method.
///
public List AdjudicateOrders(World world, List orders);
///
/// Given a list of adjudications, update the world according to the adjudication results.
///
/// The global game state.
///
/// The results of adjudication. Like , all objects to be updated
/// should have a relevant adjudication. The adjudication types will be specific to the phase
/// adjudicator.
///
///
/// A new copy of the world, updated according to the adjudication.
///
public World UpdateWorld(World world, List decisions);
}