AdvanceTimeline key to string

This commit is contained in:
Tim Van Baak 2024-08-14 22:32:48 -07:00
parent 9185534f70
commit 64f48064fc

View File

@ -13,7 +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 Dictionary<string, AdvanceTimeline> AdvanceTimeline { get; }
public IEnumerable<AdjudicationDecision> Values =>
IsDislodged.Values.Cast<AdjudicationDecision>()
@ -47,7 +47,7 @@ public class MovementDecisions
var submittedOrdersBySeason = orders.Cast<UnitOrder>().ToLookup(order => order.Unit.Season);
foreach (var group in submittedOrdersBySeason)
{
AdvanceTimeline[group.Key] = new(group.Key, group);
AdvanceTimeline[group.Key.Designation] = new(group.Key, group);
}
// Create timeline decisions for each season potentially affected by the submitted orders.
@ -60,27 +60,27 @@ public class MovementDecisions
{
case MoveOrder move:
AdvanceTimeline.Ensure(
world.Seasons[move.Season],
move.Season,
() => new(world.Seasons[move.Season], world.OrderHistory[move.Season].Orders));
AdvanceTimeline[world.Seasons[move.Season]].Orders.Add(move);
AdvanceTimeline[move.Season].Orders.Add(move);
break;
case SupportHoldOrder supportHold:
AdvanceTimeline.Ensure(
supportHold.Target.Season,
supportHold.Target.Season.Designation,
() => new(supportHold.Target.Season, world.OrderHistory[supportHold.Target.Season.Designation].Orders));
AdvanceTimeline[supportHold.Target.Season].Orders.Add(supportHold);
AdvanceTimeline[supportHold.Target.Season.Designation].Orders.Add(supportHold);
break;
case SupportMoveOrder supportMove:
AdvanceTimeline.Ensure(
supportMove.Target.Season,
supportMove.Target.Season.Designation,
() => new(supportMove.Target.Season, world.OrderHistory[supportMove.Target.Season.Designation].Orders));
AdvanceTimeline[supportMove.Target.Season].Orders.Add(supportMove);
AdvanceTimeline[supportMove.Target.Season.Designation].Orders.Add(supportMove);
AdvanceTimeline.Ensure(
supportMove.Season,
supportMove.Season.Designation,
() => new(supportMove.Season, world.OrderHistory[supportMove.Season.Designation].Orders));
AdvanceTimeline[supportMove.Season].Orders.Add(supportMove);
AdvanceTimeline[supportMove.Season.Designation].Orders.Add(supportMove);
break;
}
}