using MultiversalDiplomacy.Orders; namespace MultiversalDiplomacy.Adjudicate; /// /// Represents the result of validating an order. /// public class OrderValidation { /// /// The order that was validated. /// public Order Order { get; } /// /// Whether the order is valid. /// public bool Valid { get; } /// /// The reason for the order validation result. /// public ValidationReason Reason { get; } internal OrderValidation(Order order, bool valid, ValidationReason reason) { this.Order = order; this.Valid = valid; this.Reason = reason; } } public static class OrderValidationExtensions { /// /// Create an accepting this order. /// public static OrderValidation Validate(this Order order, ValidationReason reason) => new OrderValidation(order, true, reason); /// /// Create an rejecting this order. /// public static OrderValidation Invalidate(this Order order, ValidationReason reason) => new OrderValidation(order, false, reason); }