-
Notifications
You must be signed in to change notification settings - Fork 0
/
MesConfig.cs
87 lines (74 loc) · 2.29 KB
/
MesConfig.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
namespace Mes;
using Mes.core;
using System.Text.Json.Serialization;
public record MesConfig
:IJsonSerialize
{
[JsonInclude]
public string name = "default_config";
[JsonInclude]
public string header_delimiter = "----\n"; //NOTE:^が必要かも
[JsonInclude]
public string section_delimiter = "==";
[JsonInclude]
public FlatDialogueConfig flat_dialogue_config = new FlatDialogueConfig();
[JsonInclude]
public MesPieceConfig mes_piece_config = new MesPieceConfig();
[JsonInclude]
public DialogueCountConfig dialogue_count_config = new DialogueCountConfig();
public record DialogueCountConfig
{
[JsonInclude]
public char[] ignore_char = new[] {' '};
}
public record FlatDialogueConfig
{
[JsonInclude]
public string start_str = "「";
[JsonInclude]
public string end_str = "」";
}
public class MesPieceConfig
{
[JsonInclude]
public string block_delimitor = "\n\n";
[JsonInclude]
public string attribute_delimiter = "\n";
[JsonInclude]
public string default_charactor_name = "";
[JsonInclude]
public MesPieceDecorator decorator;
public class MesPieceDecorator
{
[JsonInclude]
public char[] dialogue = {};
[JsonInclude]
public char[] comments = {'#','#', '○' };
[JsonInclude]
public char[] sound_note = {'$','$'};
[JsonInclude]
public char[] sound_position = {'!','!'};
[JsonInclude]
public char[] charactor = {'@','@'};
[JsonInclude]
public char[] timing = {'&','&'};
[JsonInclude]
public char[] ext_field = {'?','?'};
public char[] getDecorators()
{
return this.comments.Concat(this.sound_note).Concat(this.sound_position).Concat(this.charactor).Concat(this.timing).Concat(this.ext_field).ToArray();
}
}
public MesPieceConfig()
{
this.decorator = new MesPieceDecorator();
}
}
public MesConfig()
{
}
public MesConfig(string jsonConf)
{
}
public string ToJson() => JsonSerialize.ToJson<MesConfig>(this);
}