2024-08-12 22:25:23 +00:00
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
2022-02-18 19:24:00 +00:00
|
|
|
namespace MultiversalDiplomacy.Model;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Represents a state of the map produced by a set of move orders on a previous season.
|
|
|
|
/// </summary>
|
2024-08-13 23:24:43 +00:00
|
|
|
public class Season(string? past, int turn, string timeline)
|
2022-02-18 19:24:00 +00:00
|
|
|
{
|
|
|
|
/// <summary>
|
2024-08-13 23:24:43 +00:00
|
|
|
/// The first turn number. This is defined to reduce confusion about whether the first turn is 0 or 1.
|
2022-02-18 19:24:00 +00:00
|
|
|
/// </summary>
|
|
|
|
public const int FIRST_TURN = 0;
|
|
|
|
|
2024-08-12 20:56:06 +00:00
|
|
|
/// <summary>
|
|
|
|
/// The designation of the season immediately preceding this season.
|
|
|
|
/// If this season is an alternate timeline root, the past is from the origin timeline.
|
|
|
|
/// The initial season does not have a past.
|
|
|
|
/// </summary>
|
2024-08-13 23:24:43 +00:00
|
|
|
public string? Past { get; } = past;
|
2024-08-12 20:56:06 +00:00
|
|
|
|
2022-02-18 19:24:00 +00:00
|
|
|
/// <summary>
|
|
|
|
/// The current turn, beginning at 0. Each season (spring and fall) is one turn.
|
|
|
|
/// Phases that only occur after the fall phase occur when Turn % 2 == 1.
|
|
|
|
/// The current year is (Turn / 2) + 1901.
|
|
|
|
/// </summary>
|
2024-08-13 23:24:43 +00:00
|
|
|
public int Turn { get; } = turn;
|
2022-02-18 19:24:00 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The timeline to which this season belongs.
|
|
|
|
/// </summary>
|
2024-08-13 23:24:43 +00:00
|
|
|
public string Timeline { get; } = timeline;
|
2022-02-18 19:24:00 +00:00
|
|
|
|
2022-03-30 00:16:00 +00:00
|
|
|
/// <summary>
|
2024-08-12 22:25:23 +00:00
|
|
|
/// The multiversal designation of this season.
|
2022-03-30 00:16:00 +00:00
|
|
|
/// </summary>
|
2024-08-12 22:25:23 +00:00
|
|
|
[JsonIgnore]
|
|
|
|
public string Designation => $"{this.Timeline}{this.Turn}";
|
2022-03-30 00:16:00 +00:00
|
|
|
|
2024-08-12 22:25:23 +00:00
|
|
|
public override string ToString() => Designation;
|
2022-02-18 19:24:00 +00:00
|
|
|
}
|