diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-02-13 02:10:55 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-02-13 02:10:55 -0500 |
commit | 1038f4e7041c18e1af28a627880e760fd2b221fe (patch) | |
tree | daaace5e18755ddb65679ba9241a998a8d428d6a /src | |
parent | 3b25723a4eab46b16540d10c5f0ba893f2f3a990 (diff) | |
download | SMAPI-1038f4e7041c18e1af28a627880e760fd2b221fe.tar.gz SMAPI-1038f4e7041c18e1af28a627880e760fd2b221fe.tar.bz2 SMAPI-1038f4e7041c18e1af28a627880e760fd2b221fe.zip |
mark all Command methods deprecated (#199)
Diffstat (limited to 'src')
-rw-r--r-- | src/StardewModdingAPI/Command.cs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/StardewModdingAPI/Command.cs b/src/StardewModdingAPI/Command.cs index 3b1e5632..1cbb01ff 100644 --- a/src/StardewModdingAPI/Command.cs +++ b/src/StardewModdingAPI/Command.cs @@ -73,6 +73,7 @@ namespace StardewModdingAPI /// <param name="monitor">Encapsulates monitoring and logging.</param> public static void CallCommand(string input, IMonitor monitor) { + Program.DeprecationManager.Warn("Command.CallCommand", "1.9", DeprecationLevel.Notice); Program.CommandManager.Trigger(input); } @@ -108,6 +109,7 @@ namespace StardewModdingAPI /// <param name="name">The command name to find.</param> public static Command FindCommand(string name) { + Program.DeprecationManager.Warn("Command.FindCommand", "1.9", DeprecationLevel.Notice); if (name == null) return null; @@ -125,15 +127,9 @@ namespace StardewModdingAPI /// <param name="args">The command arguments.</param> private static void Fire(string name, string[] args) { - // get legacy command Command command; if (!Command.LegacyCommands.TryGetValue(name, out command)) - { throw new InvalidOperationException($"Can't run command '{name}' because there's no such legacy command."); - return; - } - - // raise event command.Fire(); } } |