From a6f27c1c72429cf6041ab5d724defdcf684236c0 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 29 Jul 2017 14:29:05 -0400 Subject: [PATCH] refactor Fall28SnowDay This commit formats/documents/simplifies code, standardises naming conventions, etc. --- GeneralMods/Fall28SnowDay/Class1.cs | 25 ++++++++++++++++++------- GeneralMods/Fall28SnowDay/manifest.json | 2 +- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/GeneralMods/Fall28SnowDay/Class1.cs b/GeneralMods/Fall28SnowDay/Class1.cs index d736404e..71a66016 100644 --- a/GeneralMods/Fall28SnowDay/Class1.cs +++ b/GeneralMods/Fall28SnowDay/Class1.cs @@ -1,22 +1,33 @@ using StardewModdingAPI; +using StardewModdingAPI.Events; using StardewValley; namespace Omegasis.Fall28SnowDay { - public class Class1:Mod + /// The mod entry point. + public class Fall28SnowDay : Mod { + /********* + ** Public methods + *********/ + /// The mod entry point, called after the mod is first loaded. + /// Provides simplified APIs for writing mods. public override void Entry(IModHelper helper) { - StardewModdingAPI.Events.TimeEvents.DayOfMonthChanged += TimeEvents_DayOfMonthChanged; + TimeEvents.DayOfMonthChanged += this.TimeEvents_DayOfMonthChanged; } - public void TimeEvents_DayOfMonthChanged(object sender, StardewModdingAPI.Events.EventArgsIntChanged e) + + /********* + ** Private methods + *********/ + /// The method invoked when changes. + /// The event sender. + /// The event data. + public void TimeEvents_DayOfMonthChanged(object sender, EventArgsIntChanged e) { - if (StardewValley.Game1.dayOfMonth == 27 && Game1.IsFall == true) - { - // Log.Success("Weather checker now!!!"); + if (Game1.dayOfMonth == 27 && Game1.IsFall) Game1.weatherForTomorrow = Game1.weather_snow; - } } } } diff --git a/GeneralMods/Fall28SnowDay/manifest.json b/GeneralMods/Fall28SnowDay/manifest.json index 651016ab..31ee6b47 100644 --- a/GeneralMods/Fall28SnowDay/manifest.json +++ b/GeneralMods/Fall28SnowDay/manifest.json @@ -11,4 +11,4 @@ "UniqueID": "Fall28 Snow Day", "PerSaveConfigs": false, "EntryDll": "Fall28SnowDay.dll" -} \ No newline at end of file +}