Elin Decompiled Documentation EA 23.316 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 ()
 
bool HasRow (string id)
 
Dictionary< string, string > GetRow (string id)
 
void Add (ExcelData data)
 
void Clear ()
 

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

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

Referenced by Card.ApplyTone().

◆ GetToneID()

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

Definition at line 55 of file ToneDataList.cs.

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

References ExcelDataList.all, ExcelDataList.Initialize(), 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: