diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-08-09 19:10:54 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-08-09 19:10:54 -0400 |
commit | 48eb5e6be02feae26a6e374992cfeed9d60a5757 (patch) | |
tree | 123bfd97dfe22a7262ab56f4df74fc9c9414a734 /src/SMAPI/Utilities | |
parent | 066f1857a145c8b9e80a095d2dee1be6419f957b (diff) | |
download | SMAPI-48eb5e6be02feae26a6e374992cfeed9d60a5757.tar.gz SMAPI-48eb5e6be02feae26a6e374992cfeed9d60a5757.tar.bz2 SMAPI-48eb5e6be02feae26a6e374992cfeed9d60a5757.zip |
add support for read/writing SDate to JSON
Diffstat (limited to 'src/SMAPI/Utilities')
-rw-r--r-- | src/SMAPI/Utilities/SDate.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/SMAPI/Utilities/SDate.cs b/src/SMAPI/Utilities/SDate.cs index 03230334..165667a4 100644 --- a/src/SMAPI/Utilities/SDate.cs +++ b/src/SMAPI/Utilities/SDate.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using Newtonsoft.Json; using StardewModdingAPI.Framework; using StardewValley; @@ -35,15 +36,18 @@ namespace StardewModdingAPI.Utilities /// <summary>The index of the season (where 0 is spring, 1 is summer, 2 is fall, and 3 is winter).</summary> /// <remarks>This is used in some game calculations (e.g. seasonal game sprites) and methods (e.g. <see cref="Utility.getSeasonNameFromNumber"/>).</remarks> + [JsonIgnore] public int SeasonIndex { get; } /// <summary>The year.</summary> public int Year { get; } /// <summary>The day of week.</summary> + [JsonIgnore] public DayOfWeek DayOfWeek { get; } /// <summary>The number of days since the game began (starting at 1 for the first day of spring in Y1).</summary> + [JsonIgnore] public int DaysSinceStart { get; } @@ -62,6 +66,7 @@ namespace StardewModdingAPI.Utilities /// <param name="season">The season name.</param> /// <param name="year">The year.</param> /// <exception cref="ArgumentException">One of the arguments has an invalid value (like day 35).</exception> + [JsonConstructor] public SDate(int day, string season, int year) : this(day, season, year, allowDayZero: false) { } |