From f904b3da9728ee51c76e95915b78623a7638de26 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 2 Jul 2017 18:17:20 -0400 Subject: add unified player_add command which adds any item type (#302) --- .../Framework/Commands/Player/AddRingCommand.cs | 33 ---------------------- 1 file changed, 33 deletions(-) delete mode 100644 src/TrainerMod/Framework/Commands/Player/AddRingCommand.cs (limited to 'src/TrainerMod/Framework/Commands/Player/AddRingCommand.cs') diff --git a/src/TrainerMod/Framework/Commands/Player/AddRingCommand.cs b/src/TrainerMod/Framework/Commands/Player/AddRingCommand.cs deleted file mode 100644 index 93c5b2a5..00000000 --- a/src/TrainerMod/Framework/Commands/Player/AddRingCommand.cs +++ /dev/null @@ -1,33 +0,0 @@ -using StardewModdingAPI; -using StardewValley; -using StardewValley.Objects; - -namespace TrainerMod.Framework.Commands.Player -{ - /// A command which adds a ring to the player inventory. - internal class AddRingCommand : TrainerCommand - { - /********* - ** Public methods - *********/ - /// Construct an instance. - public AddRingCommand() - : base("player_addring", "Gives the player a ring.\n\nUsage: player_addring \n- item: the ring ID (use the 'list_items' command to see a list).") { } - - /// Handle the command. - /// Writes messages to the console and log file. - /// The command name. - /// The command arguments. - public override void Handle(IMonitor monitor, string command, ArgumentParser args) - { - // parse arguments - if (!args.TryGetInt(0, "ring ID", out int ringID, min: Ring.ringLowerIndexRange, max: Ring.ringUpperIndexRange)) - return; - - // handle - Ring ring = new Ring(ringID); - Game1.player.addItemByMenuIfNecessary(ring); - monitor.Log($"OK, added {ring.Name} to your inventory.", LogLevel.Info); - } - } -} -- cgit