Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ToneDataList Class Reference
Inheritance diagram for ToneDataList:
ExcelDataList

Public Member Functions

override void OnInitialize ()
 
StringBuilder ApplyTone (string id, ref string text, int gender)
 
string GetToneID (string id, int gender)
 
- Public Member Functions inherited from ExcelDataList
void Reload ()
 
virtual void Initialize ()
 
virtual void OnInitialize ()
 
Dictionary< string, string > GetRow (string id)
 

Additional Inherited Members

- Public Attributes inherited from ExcelDataList
List< ExcelDataitems = new List<ExcelData>(0)
 
Dictionary< string, Dictionary< string, string > > all = new Dictionary<string, Dictionary<string, string>>()
 
List< Dictionary< string, string > > list = new List<Dictionary<string, string>>()
 
- Protected Attributes inherited from ExcelDataList
bool initialized
 
- Properties inherited from ExcelDataList
virtual int StartIndex [get]
 

Detailed Description

Definition at line 5 of file ToneDataList.cs.

Member Function Documentation

◆ ApplyTone()

StringBuilder ToneDataList.ApplyTone ( string  id,
ref string  text,
int  gender 
)
inline

Definition at line 11 of file ToneDataList.cs.

12 {
13 if (!initialized)
14 {
15 Initialize();
16 }
17 Dictionary<string, string> dictionary = all[id];
18 StringBuilder stringBuilder = new StringBuilder();
19 bool flag = false;
20 string text2 = "";
21 for (int i = 0; i < text.Length; i++)
22 {
23 if (flag)
24 {
25 if (text[i] == '}')
26 {
27 flag = false;
28 if (dictionary.ContainsKey(text2))
29 {
30 string text3 = dictionary[text2].Split(new string[3] { "\r\n", "\r", "\n" }, StringSplitOptions.None).TryGet((gender != 2) ? 1 : 0, 0);
31 stringBuilder.Append(text3.Split(',').RandomItem());
32 }
33 else
34 {
35 stringBuilder.Append(text2);
36 }
37 }
38 else
39 {
40 text2 += text[i];
41 }
42 }
43 else if (text[i] == '{')
44 {
45 text2 = "";
46 flag = true;
47 }
48 else
49 {
50 stringBuilder.Append(text[i]);
51 }
52 }
53 stringBuilder.Replace("…~", "~…");
54 stringBuilder.Replace("…ー", "ー…");
55 return stringBuilder;
56 }
Dictionary< string, Dictionary< string, string > > all
Definition: ExcelDataList.cs:8
virtual void Initialize()

References ExcelDataList.all, ExcelDataList.Initialize(), and ExcelDataList.initialized.

Referenced by Card.ApplyTone().

◆ GetToneID()

string ToneDataList.GetToneID ( string  id,
int  gender 
)
inline

Definition at line 58 of file ToneDataList.cs.

59 {
60 if (!initialized)
61 {
62 Initialize();
63 }
64 if (!Lang.isJP)
65 {
66 return id + "|I|YOU";
67 }
68 Dictionary<string, string> dictionary = all[id];
69 string text = dictionary["I"].Split(new string[3] { "\r\n", "\r", "\n" }, StringSplitOptions.None).TryGet((gender != 2) ? 1 : 0, 0);
70 string text2 = dictionary["YOU"].Split(new string[3] { "\r\n", "\r", "\n" }, StringSplitOptions.None).TryGet((gender != 2) ? 1 : 0, 0);
71 string[] array = text.Split(',');
72 string[] array2 = text2.Split(',');
73 return id + "|" + array[rnd(rnd(array.Length) + 1)] + "|" + array2[rnd(rnd(array2.Length) + 1)];
74 static int rnd(int a)
75 {
76 return Rand.rnd(a);
77 }
78 }
Definition: Lang.cs:6
static bool isJP
Definition: Lang.cs:38
Definition: Rand.cs:4
static int rnd(int max)
Definition: Rand.cs:52

References ExcelDataList.all, ExcelDataList.Initialize(), ExcelDataList.initialized, Lang.isJP, and Rand.rnd().

Referenced by Card.SetRandomTone().

◆ OnInitialize()

override void ToneDataList.OnInitialize ( )
inlinevirtual

Reimplemented from ExcelDataList.

Definition at line 7 of file ToneDataList.cs.

8 {
9 }

The documentation for this class was generated from the following file: