Add an AdvanceTimeline decision type

This commit is contained in:
Jaculabilis 2022-11-06 14:39:01 -08:00
parent f5acb8325c
commit 18c11c7ffd
2 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,16 @@
using MultiversalDiplomacy.Model;
using MultiversalDiplomacy.Orders;
namespace MultiversalDiplomacy.Adjudicate.Decision;
public class AdvanceTimeline : BinaryAdjudicationDecision
{
public Season Season { get; }
public List<UnitOrder> Orders { get; }
public AdvanceTimeline(Season season, IEnumerable<UnitOrder> orders)
{
this.Season = season;
this.Orders = orders.ToList();
}
}

View File

@ -13,6 +13,7 @@ public class MovementDecisions
public Dictionary<MoveOrder, DefendStrength> DefendStrength { get; }
public Dictionary<MoveOrder, PreventStrength> PreventStrength { get; }
public Dictionary<MoveOrder, DoesMove> DoesMove { get; }
public Dictionary<Season, AdvanceTimeline> AdvanceTimeline { get; }
public IEnumerable<AdjudicationDecision> Values =>
this.IsDislodged.Values.Cast<AdjudicationDecision>()
@ -22,7 +23,8 @@ public class MovementDecisions
.Concat(this.AttackStrength.Values)
.Concat(this.DefendStrength.Values)
.Concat(this.PreventStrength.Values)
.Concat(this.DoesMove.Values);
.Concat(this.DoesMove.Values)
.Concat(this.AdvanceTimeline.Values);
public MovementDecisions(World world, List<Order> orders)
{
@ -34,6 +36,7 @@ public class MovementDecisions
this.DefendStrength = new();
this.PreventStrength = new();
this.DoesMove = new();
this.AdvanceTimeline = new();
// Record which seasons are referenced by the order set.
HashSet<Season> orderedSeasons = new();