Add Timelines.All shortcut
This commit is contained in:
parent
868138b988
commit
973f8ea0d7
|
@ -66,11 +66,17 @@ public class Timelines(int next, Dictionary<string, Season?> pasts)
|
||||||
public int Next { get; private set; } = next;
|
public int Next { get; private set; } = next;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Map of season designations to their parent seasons.
|
/// Map of season designations to their parent seasons. Every season has an entry, so
|
||||||
/// The set of keys here is the set of all seasons in the multiverse.
|
/// the set of keys is the set of existing seasons.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Dictionary<string, Season?> Pasts { get; } = pasts;
|
public Dictionary<string, Season?> Pasts { get; } = pasts;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// All seasons in the multiverse.
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
|
public IEnumerable<Season> Seasons => Pasts.Keys.Select(key => new Season(key));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a new multiverse with an initial season.
|
/// Create a new multiverse with an initial season.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -33,11 +33,11 @@ public class TimeTravelTest
|
||||||
|
|
||||||
// Confirm that there are now four seasons: three in the main timeline and one in a fork.
|
// Confirm that there are now four seasons: three in the main timeline and one in a fork.
|
||||||
Assert.That(
|
Assert.That(
|
||||||
world.Timelines.Pasts.Keys.Select(key => new Season(key)).Where(s => s.Timeline == s0.Timeline).Count(),
|
world.Timelines.Seasons.Where(s => s.Timeline == s0.Timeline).Count(),
|
||||||
Is.EqualTo(3),
|
Is.EqualTo(3),
|
||||||
"Failed to advance main timeline after last unit left");
|
"Failed to advance main timeline after last unit left");
|
||||||
Assert.That(
|
Assert.That(
|
||||||
world.Timelines.Pasts.Keys.Select(key => new Season(key)).Where(s => s.Timeline != s0.Timeline).Count(),
|
world.Timelines.Seasons.Where(s => s.Timeline != s0.Timeline).Count(),
|
||||||
Is.EqualTo(1),
|
Is.EqualTo(1),
|
||||||
"Failed to fork timeline when unit moved in");
|
"Failed to fork timeline when unit moved in");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue