-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathFlag.cs
More file actions
41 lines (35 loc) · 1.04 KB
/
Flag.cs
File metadata and controls
41 lines (35 loc) · 1.04 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
namespace ScriptedEvents.Structures
{
using System;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Represents a flag, a script component that modifies a script's behavior.
/// </summary>
public struct Flag
{
public Flag(string key, IEnumerable<string> arguments)
{
Key = key;
if (arguments is null)
{
Arguments = Array.Empty<string>();
return;
}
Arguments = arguments.Select(s => s.Trim()).ToArray();
}
/// <summary>
/// Gets or sets the flag's key.
/// </summary>
public string Key { get; set; }
/// <summary>
/// Gets or sets the flag's arguments.
/// </summary>
public string[] Arguments { get; set; }
/// <inheritdoc/>
public override readonly string ToString()
{
return $"!-- {Key} [{string.Join(" ", Arguments)}]";
}
}
}