-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSchema.cs
72 lines (49 loc) · 1.28 KB
/
Schema.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System.ComponentModel;
using YamlDotNet.Serialization;
namespace EXDTooler.Schema;
public record Sheet
{
public required string Name { get; set; }
public string? DisplayField { get; set; }
public required List<Field> Fields { get; set; }
public List<Field>? PendingFields { get; set; }
public RelationsCollection? Relations { get; set; }
}
public record Field
{
[YamlMember(Order = 0)]
public string? Name { get; set; }
public string? PendingName { get; set; }
[DefaultValue(FieldType.Scalar)]
public FieldType Type { get; set; }
public int? Count { get; set; }
public string? Comment { get; set; }
public List<Field>? Fields { get; set; }
public RelationsCollection? Relations { get; set; }
public Condition? Condition { get; set; }
public SheetTargets? Targets { get; set; }
public override string ToString()
{
return $"{Name} ({Type})";
}
}
public enum FieldType
{
Scalar,
Link,
Array,
Icon,
ModelId,
Color,
}
public record Condition
{
public string? Switch { get; set; }
public Dictionary<int, SheetTargets>? Cases { get; set; }
}
public sealed class RelationsCollection : Dictionary<string, List<string>>
{
}
public sealed class SheetTargets : List<string>
{
}