-
Notifications
You must be signed in to change notification settings - Fork 0
/
ArrowheadOptions.cs
41 lines (32 loc) · 1.02 KB
/
ArrowheadOptions.cs
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
using System;
using System.Text;
using D2.Enums;
using D2.Extensions;
using static D2.Constants;
namespace D2
{
public class ArrowheadOptions
{
private ArrowheadType? _type { get; }
private string _label { get; }
private bool _fill { get; }
public ArrowheadOptions(ArrowheadType type, string label = "", bool fill = true)
{
_type = type;
_label = label;
_fill = fill;
}
public override string ToString()
{
var sb = new StringBuilder();
if (!string.IsNullOrWhiteSpace(_label))
sb.Append($"{_label} ");
if (!_type.HasValue) return sb.ToString();
sb.Append(OPEN_CONTAINER);
sb.Append($" shape: {_type.Value.ToCatalog()};"); // TODO: Determine if fill is default for given arrowhead type
sb.Append($" style.filled: {_fill.ToString().ToLower()} ");
sb.Append(CLOSE_CONTAINER);
return sb.ToString();
}
}
}