summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-02-13 02:10:55 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-02-13 02:10:55 -0500
commit1038f4e7041c18e1af28a627880e760fd2b221fe (patch)
treedaaace5e18755ddb65679ba9241a998a8d428d6a /src
parent3b25723a4eab46b16540d10c5f0ba893f2f3a990 (diff)
downloadSMAPI-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.cs8
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();
}
}