Use correct builder pattern
This commit is contained in:
parent
2de1622638
commit
d247b843ee
2 changed files with 9 additions and 9 deletions
|
@ -106,7 +106,7 @@ namespace LibAC.Arguments
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a predefined argument for a string type.
|
/// Adds a predefined argument for a string type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ArgumentBuilder AddStringArgument(string key, string? value = null, bool required = false)
|
public ArgumentBuilder withStringArgument(string key, string? value = null, bool required = false)
|
||||||
{
|
{
|
||||||
IArgument arg = new StringArgument(key, value);
|
IArgument arg = new StringArgument(key, value);
|
||||||
arg.required = required;
|
arg.required = required;
|
||||||
|
@ -117,7 +117,7 @@ namespace LibAC.Arguments
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a predefined argument for an integer type.
|
/// Adds a predefined argument for an integer type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ArgumentBuilder AddIntegerArgument(string key, int? value = null, bool required = false)
|
public ArgumentBuilder withIntegerArgument(string key, int? value = null, bool required = false)
|
||||||
{
|
{
|
||||||
IArgument arg = new IntegerArgument(key, value);
|
IArgument arg = new IntegerArgument(key, value);
|
||||||
arg.required = required;
|
arg.required = required;
|
||||||
|
@ -128,7 +128,7 @@ namespace LibAC.Arguments
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a predefined argument for a boolean type.
|
/// Adds a predefined argument for a boolean type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ArgumentBuilder AddBooleanArgument(string key, bool? value = null, bool required = false)
|
public ArgumentBuilder withBooleanArgument(string key, bool? value = null, bool required = false)
|
||||||
{
|
{
|
||||||
IArgument arg = new BooleanArgument(key, value);
|
IArgument arg = new BooleanArgument(key, value);
|
||||||
arg.required = required;
|
arg.required = required;
|
||||||
|
@ -139,7 +139,7 @@ namespace LibAC.Arguments
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a predefined argument for a float type.
|
/// Adds a predefined argument for a float type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ArgumentBuilder AddFloatArgument(string key, float? value = null, bool required = false)
|
public ArgumentBuilder withFloatArgument(string key, float? value = null, bool required = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
IArgument arg = new FloatArgument(key, value);
|
IArgument arg = new FloatArgument(key, value);
|
||||||
|
@ -151,7 +151,7 @@ namespace LibAC.Arguments
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a predefined argument for a double type.
|
/// Adds a predefined argument for a double type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ArgumentBuilder AddDoubleArgument(string key, double? value = null, bool required = false)
|
public ArgumentBuilder withDoubleArgument(string key, double? value = null, bool required = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
IArgument arg = new DoubleArgument(key, value);
|
IArgument arg = new DoubleArgument(key, value);
|
||||||
|
@ -163,7 +163,7 @@ namespace LibAC.Arguments
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a predefined 'help' argument (usually a flag).
|
/// Adds a predefined 'help' argument (usually a flag).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ArgumentBuilder AddHelpArgument()
|
public ArgumentBuilder withHelpArgument()
|
||||||
{
|
{
|
||||||
_arguments.AddArgument(new BooleanArgument("help", false)); // or true based on logic
|
_arguments.AddArgument(new BooleanArgument("help", false)); // or true based on logic
|
||||||
return this;
|
return this;
|
||||||
|
@ -172,7 +172,7 @@ namespace LibAC.Arguments
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a predefined 'version' argument.
|
/// Adds a predefined 'version' argument.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ArgumentBuilder AddVersionArgument()
|
public ArgumentBuilder withVersionArgument()
|
||||||
{
|
{
|
||||||
_arguments.AddArgument(new BooleanArgument("version"));
|
_arguments.AddArgument(new BooleanArgument("version"));
|
||||||
return this;
|
return this;
|
||||||
|
|
4
LibAC.cs
4
LibAC.cs
|
@ -5,14 +5,14 @@ using System.Reflection;
|
||||||
[assembly:AssemblyDefaultAlias("LibAC")]
|
[assembly:AssemblyDefaultAlias("LibAC")]
|
||||||
[assembly:AssemblyTitle("LibAC")]
|
[assembly:AssemblyTitle("LibAC")]
|
||||||
[assembly:AssemblyDescription("Aria's Creations Common Code Library")]
|
[assembly:AssemblyDescription("Aria's Creations Common Code Library")]
|
||||||
[assembly:AssemblyVersion("1.3.0.3")]
|
[assembly:AssemblyVersion("1.3.0.4")]
|
||||||
|
|
||||||
namespace LibAC
|
namespace LibAC
|
||||||
{
|
{
|
||||||
public class LibAC
|
public class LibAC
|
||||||
{
|
{
|
||||||
public static readonly string BUILD_DATE = "121724";
|
public static readonly string BUILD_DATE = "121724";
|
||||||
public static readonly string BUILD_TIME = "1144";
|
public static readonly string BUILD_TIME = "1150";
|
||||||
|
|
||||||
public static string VERSION => $"1.3.${BUILD_DATE}.${BUILD_TIME}";
|
public static string VERSION => $"1.3.${BUILD_DATE}.${BUILD_TIME}";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue