summaryrefslogtreecommitdiff
path: root/src/SMAPI.Mods.ConsoleCommands/ModEntry.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-01-22 20:29:08 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-01-22 20:29:08 -0500
commit4b5dd0f2c9ed530e97a783aedb3de73425d24516 (patch)
treee0f10f631f6858c4abe6fe50e2631a9e12b90553 /src/SMAPI.Mods.ConsoleCommands/ModEntry.cs
parentcea8e557efef1be5466cbb7102b4e163c34394c2 (diff)
downloadSMAPI-4b5dd0f2c9ed530e97a783aedb3de73425d24516.tar.gz
SMAPI-4b5dd0f2c9ed530e97a783aedb3de73425d24516.tar.bz2
SMAPI-4b5dd0f2c9ed530e97a783aedb3de73425d24516.zip
rename TrainerCommand to ConsoleCommand to match the rest of the code
Diffstat (limited to 'src/SMAPI.Mods.ConsoleCommands/ModEntry.cs')
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/ModEntry.cs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/SMAPI.Mods.ConsoleCommands/ModEntry.cs b/src/SMAPI.Mods.ConsoleCommands/ModEntry.cs
index 5c4f3bba..91437fd3 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 ITrainerCommand[] Commands;
+ private IConsoleCommand[] Commands;
/// <summary>The commands which may need to handle update ticks.</summary>
- private ITrainerCommand[] UpdateHandlers;
+ private IConsoleCommand[] UpdateHandlers;
/// <summary>The commands which may need to handle input.</summary>
- private ITrainerCommand[] InputHandlers;
+ private IConsoleCommand[] InputHandlers;
/*********
@@ -31,7 +31,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands
{
// register commands
this.Commands = this.ScanForCommands().ToArray();
- foreach (ITrainerCommand command in this.Commands)
+ foreach (IConsoleCommand command in this.Commands)
helper.ConsoleCommands.Add(command.Name, command.Description, (name, args) => this.HandleCommand(command, name, args));
// cache commands
@@ -52,7 +52,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands
/// <param name="e">The event arguments.</param>
private void OnButtonPressed(object sender, ButtonPressedEventArgs e)
{
- foreach (ITrainerCommand command in this.InputHandlers)
+ foreach (IConsoleCommand command in this.InputHandlers)
command.OnButtonPressed(this.Monitor, e.Button);
}
@@ -61,7 +61,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands
/// <param name="e">The event arguments.</param>
private void OnUpdateTicked(object sender, EventArgs e)
{
- foreach (ITrainerCommand command in this.UpdateHandlers)
+ foreach (IConsoleCommand command in this.UpdateHandlers)
command.OnUpdated(this.Monitor);
}
@@ -69,19 +69,19 @@ namespace StardewModdingAPI.Mods.ConsoleCommands
/// <param name="command">The command to invoke.</param>
/// <param name="commandName">The command name specified by the user.</param>
/// <param name="args">The command arguments.</param>
- private void HandleCommand(ITrainerCommand command, string commandName, string[] args)
+ private void HandleCommand(IConsoleCommand command, string commandName, string[] args)
{
ArgumentParser argParser = new ArgumentParser(commandName, args, this.Monitor);
command.Handle(this.Monitor, commandName, argParser);
}
/// <summary>Find all commands in the assembly.</summary>
- private IEnumerable<ITrainerCommand> ScanForCommands()
+ private IEnumerable<IConsoleCommand> ScanForCommands()
{
return (
from type in this.GetType().Assembly.GetTypes()
- where !type.IsAbstract && typeof(ITrainerCommand).IsAssignableFrom(type)
- select (ITrainerCommand)Activator.CreateInstance(type)
+ where !type.IsAbstract && typeof(IConsoleCommand).IsAssignableFrom(type)
+ select (IConsoleCommand)Activator.CreateInstance(type)
);
}
}