#nullable disable
using System;
namespace StardewModdingAPI.Framework
{
/// A command that can be submitted through the SMAPI console to interact with SMAPI.
internal class Command
{
/*********
** Accessor
*********/
/// The mod that registered the command (or null if registered by SMAPI).
public IModMetadata Mod { 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 mod that registered the command (or null if registered by SMAPI).
/// 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(IModMetadata mod, string name, string documentation, Action callback)
{
this.Mod = mod;
this.Name = name;
this.Documentation = documentation;
this.Callback = callback;
}
}
}