diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-05-01 18:16:09 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-05-01 18:16:09 -0400 |
commit | c8ad50dad1d706a1901798f9396f6becfea36c0e (patch) | |
tree | 28bd818a5db39ec5ece1bd141a28de955950463b /src/SMAPI.Mods.ConsoleCommands/ModEntry.cs | |
parent | 451b70953ff4c0b1b27ae0de203ad99379b45b2a (diff) | |
parent | f78093bdb58d477b400cde3f19b70ffd6ddf833d (diff) | |
download | SMAPI-c8ad50dad1d706a1901798f9396f6becfea36c0e.tar.gz SMAPI-c8ad50dad1d706a1901798f9396f6becfea36c0e.tar.bz2 SMAPI-c8ad50dad1d706a1901798f9396f6becfea36c0e.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI.Mods.ConsoleCommands/ModEntry.cs')
-rw-r--r-- | src/SMAPI.Mods.ConsoleCommands/ModEntry.cs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/SMAPI.Mods.ConsoleCommands/ModEntry.cs b/src/SMAPI.Mods.ConsoleCommands/ModEntry.cs index 91437fd3..dbfca815 100644 --- a/src/SMAPI.Mods.ConsoleCommands/ModEntry.cs +++ b/src/SMAPI.Mods.ConsoleCommands/ModEntry.cs @@ -13,13 +13,13 @@ namespace StardewModdingAPI.Mods.ConsoleCommands ** Fields *********/ /// <summary>The commands to handle.</summary> - private IConsoleCommand[] Commands; + private IConsoleCommand[] Commands = null!; /// <summary>The commands which may need to handle update ticks.</summary> - private IConsoleCommand[] UpdateHandlers; + private IConsoleCommand[] UpdateHandlers = null!; /// <summary>The commands which may need to handle input.</summary> - private IConsoleCommand[] InputHandlers; + private IConsoleCommand[] InputHandlers = null!; /********* @@ -50,7 +50,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands /// <summary>The method invoked when a button is pressed.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> - private void OnButtonPressed(object sender, ButtonPressedEventArgs e) + private void OnButtonPressed(object? sender, ButtonPressedEventArgs e) { foreach (IConsoleCommand command in this.InputHandlers) command.OnButtonPressed(this.Monitor, e.Button); @@ -59,7 +59,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands /// <summary>The method invoked when the game updates its state.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> - private void OnUpdateTicked(object sender, EventArgs e) + private void OnUpdateTicked(object? sender, EventArgs e) { foreach (IConsoleCommand command in this.UpdateHandlers) command.OnUpdated(this.Monitor); @@ -71,7 +71,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands /// <param name="args">The command arguments.</param> private void HandleCommand(IConsoleCommand command, string commandName, string[] args) { - ArgumentParser argParser = new ArgumentParser(commandName, args, this.Monitor); + ArgumentParser argParser = new(commandName, args, this.Monitor); command.Handle(this.Monitor, commandName, argParser); } @@ -81,7 +81,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands return ( from type in this.GetType().Assembly.GetTypes() where !type.IsAbstract && typeof(IConsoleCommand).IsAssignableFrom(type) - select (IConsoleCommand)Activator.CreateInstance(type) + select (IConsoleCommand)Activator.CreateInstance(type)! ); } } |