using Quadarax.Foundation.Core.QConsole.Value;

namespace Quadarax.Foundation.Core.QConsole.Argument
{
    public class FlagArgument : NamedArgument
    {
        public FlagArgument(string code, string description, string hint, bool defaultValue) : base(code, description, hint, TypeValuesEnum.Bool, defaultValue.ToString(), false)
        {
            Reset();
        }

        public void Set()
        {
            Value.Set(!(bool)DefaultValue.Get());
            Hit();
        }

        public void Reset()
        {
            Value.Set(DefaultValue.Get());
        }
    }
}
