From 4b5dd0f2c9ed530e97a783aedb3de73425d24516 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 22 Jan 2021 20:29:08 -0500 Subject: rename TrainerCommand to ConsoleCommand to match the rest of the code --- .../Framework/Commands/IConsoleCommand.cs | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/SMAPI.Mods.ConsoleCommands/Framework/Commands/IConsoleCommand.cs (limited to 'src/SMAPI.Mods.ConsoleCommands/Framework/Commands/IConsoleCommand.cs') diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/IConsoleCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/IConsoleCommand.cs new file mode 100644 index 00000000..9c82bbd3 --- /dev/null +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/IConsoleCommand.cs @@ -0,0 +1,40 @@ +namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands +{ + /// A console command to register. + internal interface IConsoleCommand + { + /********* + ** Accessors + *********/ + /// The command name the user must type. + string Name { get; } + + /// The command description. + string Description { get; } + + /// Whether the command may need to perform logic when the game updates. This value shouldn't change. + bool MayNeedUpdate { get; } + + /// Whether the command may need to perform logic when the player presses a button. This value shouldn't change. + bool MayNeedInput { get; } + + + /********* + ** Public methods + *********/ + /// Handle the command. + /// Writes messages to the console and log file. + /// The command name. + /// The command arguments. + void Handle(IMonitor monitor, string command, ArgumentParser args); + + /// Perform any logic needed on update tick. + /// Writes messages to the console and log file. + void OnUpdated(IMonitor monitor); + + /// Perform any logic when input is received. + /// Writes messages to the console and log file. + /// The button that was pressed. + void OnButtonPressed(IMonitor monitor, SButton button); + } +} -- cgit