Elin Decompiled Documentation EA 23.321 Nightly Patch 1
Loading...
Searching...
No Matches
TalkDataList Class Reference
Inheritance diagram for TalkDataList:
ExcelDataList

Public Member Functions

override void OnInitialize ()
 
string GetTalk (string id, string idTopic, bool useDefault=false, bool human=true)
 
string GetRandomID (string tag)
 
- 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 ()
 

Public Attributes

List< string > IDs
 
- 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>>()
 

Properties

override int StartIndex [get]
 
- Properties inherited from ExcelDataList
virtual int StartIndex [get]
 

Additional Inherited Members

- Protected Attributes inherited from ExcelDataList
bool initialized
 

Detailed Description

Definition at line 5 of file TalkDataList.cs.

Member Function Documentation

◆ GetRandomID()

string TalkDataList.GetRandomID ( string  tag)
inline

Definition at line 54 of file TalkDataList.cs.

55 {
56 return IDs.RandomItem();
57 }
List< string > IDs
Definition: TalkDataList.cs:7

References IDs.

Referenced by Card.SetRandomTalk().

◆ GetTalk()

string TalkDataList.GetTalk ( string  id,
string  idTopic,
bool  useDefault = false,
bool  human = true 
)
inline

Definition at line 23 of file TalkDataList.cs.

24 {
25 bool flag = false;
26 Dictionary<string, string> row = GetRow(idTopic);
27 if (row == null)
28 {
29 return "";
30 }
31 string text = row.TryGetValue(id);
32 if (text.IsEmpty())
33 {
34 if (!useDefault)
35 {
36 Debug.LogError("id not found:" + id);
37 return "";
38 }
39 text = row.TryGetValue("default");
40 flag = true;
41 }
42 text = text.Split(new string[3] { "\r\n", "\r", "\n" }, StringSplitOptions.None).RandomItem();
43 if (!human)
44 {
45 if (flag && !text.IsEmpty() && !text.StartsWith("(") && !text.StartsWith("*"))
46 {
47 text = "(" + text + ")";
48 }
49 text = text.Replace("。)", ")");
50 }
51 return text;
52 }
@ human
Dictionary< string, string > GetRow(string id)

References Debug, ExcelDataList.GetRow(), and human.

Referenced by Person.GetDramaTitle(), Card.GetTalkText(), and Card.HasTalk().

◆ OnInitialize()

override void TalkDataList.OnInitialize ( )
inlinevirtual

Reimplemented from ExcelDataList.

Definition at line 11 of file TalkDataList.cs.

12 {
13 IDs = new List<string>();
14 foreach (string key in list[0].Keys)
15 {
16 if (key != "id" && key != "path")
17 {
18 IDs.Add(key);
19 }
20 }
21 }
List< Dictionary< string, string > > list

References IDs, and ExcelDataList.list.

Member Data Documentation

◆ IDs

List<string> TalkDataList.IDs

Definition at line 7 of file TalkDataList.cs.

Referenced by GetRandomID(), and OnInitialize().

Property Documentation

◆ StartIndex

override int TalkDataList.StartIndex
get

Definition at line 9 of file TalkDataList.cs.


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