2024-03-15 08:27:35 -04:00
|
|
|
namespace TwitchChatTTS.Chat.Commands.Parameters
|
|
|
|
{
|
2024-06-16 20:19:31 -04:00
|
|
|
public abstract class ChatCommandParameter : ICloneable
|
2024-03-15 08:27:35 -04:00
|
|
|
{
|
|
|
|
public string Name { get; }
|
|
|
|
public string Description { get; }
|
2024-06-16 20:19:31 -04:00
|
|
|
public bool Optional { get; private set; }
|
2024-03-15 08:27:35 -04:00
|
|
|
|
2024-06-16 20:19:31 -04:00
|
|
|
public ChatCommandParameter(string name, string description, bool optional = false)
|
|
|
|
{
|
2024-03-15 08:27:35 -04:00
|
|
|
Name = name;
|
|
|
|
Description = description;
|
|
|
|
Optional = optional;
|
|
|
|
}
|
|
|
|
|
|
|
|
public abstract bool Validate(string value);
|
2024-06-16 20:19:31 -04:00
|
|
|
|
|
|
|
public object Clone() {
|
|
|
|
return (ChatCommandParameter) MemberwiseClone();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ChatCommandParameter Permissive() {
|
|
|
|
Optional = true;
|
|
|
|
return this;
|
|
|
|
}
|
2024-03-15 08:27:35 -04:00
|
|
|
}
|
|
|
|
}
|