-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathArgument.cs
More file actions
55 lines (47 loc) · 1.75 KB
/
Argument.cs
File metadata and controls
55 lines (47 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
namespace ScriptedEvents.Structures
{
using System;
using ScriptedEvents.API.Features;
/// <summary>
/// Represents an argument for an action.
/// </summary>
public class Argument
{
/// <summary>
/// Initializes a new instance of the <see cref="Argument"/> class.
/// </summary>
/// <param name="argumentName">The name of the argument.</param>
/// <param name="type">The type of the argument.</param>
/// <param name="description">The description of the argument.</param>
/// <param name="required">Whether or not the argument is required.</param>
public Argument(string argumentName, Type type, string description, bool required)
{
ArgumentName = argumentName;
Type = type;
Description = description;
Required = required;
}
/// <summary>
/// Gets the name of the argument.
/// </summary>
public string ArgumentName { get; }
/// <summary>
/// Gets the type of the argument.
/// </summary>
public Type Type { get; }
/// <summary>
/// Gets the description of the argument.
/// </summary>
public string Description { get; }
/// <summary>
/// Gets a value indicating whether or not the argument is required.
/// </summary>
public bool Required { get; }
/// <summary>
/// Gets the <see cref="Type"/> in a human-readable form.
/// </summary>
public string TypeString => Type.Display();
public override string ToString() =>
$"{ArgumentName} [T: {TypeString}] [R: {Required}] | {Description}";
}
}