using System; namespace StardewModdingAPI.Framework { /// A command that can be submitted through the SMAPI console to interact with SMAPI. internal class Command { /********* ** Accessor *********/ /// The friendly name for the mod that registered the command. public string ModName { get; } /// The command name, which the user must type to trigger it. public string Name { get; } /// The human-readable documentation shown when the player runs the built-in 'help' command. public string Documentation { get; } /// The method to invoke when the command is triggered. This method is passed the command name and arguments submitted by the user. public Action Callback { get; } /********* ** Public methods *********/ /// Construct an instance. /// The friendly name for the mod that registered the command. /// The command name, which the user must type to trigger it. /// The human-readable documentation shown when the player runs the built-in 'help' command. /// The method to invoke when the command is triggered. This method is passed the command name and arguments submitted by the user. public Command(string modName, string name, string documentation, Action callback) { this.ModName = modName; this.Name = name; this.Documentation = documentation; this.Callback = callback; } } }