Elin Decompiled Documentation EA 23.316 Nightly
Loading...
Searching...
No Matches
GodTalkDataList.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2
4{
5 public override int StartIndex => 3;
6
7 public override void Initialize()
8 {
9 if (initialized)
10 {
11 return;
12 }
13 foreach (ExcelData item in items)
14 {
15 item.startIndex = StartIndex;
16 item.BuildMap();
17 foreach (KeyValuePair<string, Dictionary<string, string>> item2 in item.sheets["_default"].map)
18 {
19 item2.Deconstruct(out var key, out var value);
20 string key2 = key;
21 Dictionary<string, string> dictionary = value;
22 if (all.TryAdd(key2, dictionary))
23 {
24 list.Add(dictionary);
25 continue;
26 }
27 foreach (KeyValuePair<string, string> item3 in dictionary)
28 {
29 item3.Deconstruct(out key, out var value2);
30 string key3 = key;
31 string value3 = value2;
32 all[key2][key3] = value3;
33 }
34 }
35 }
36 initialized = true;
37 }
38
39 public string GetTalk(string id, string idTopic)
40 {
41 Dictionary<string, string> row = GetRow(idTopic);
42 return ((row == null) ? null : row.TryGetValue(id)?.SplitByNewline().RandomItem()) ?? "";
43 }
44}
Dictionary< string, Dictionary< string, string > > all
Definition: ExcelDataList.cs:8
List< ExcelData > items
Definition: ExcelDataList.cs:6
List< Dictionary< string, string > > list
Dictionary< string, string > GetRow(string id)
override int StartIndex
string GetTalk(string id, string idTopic)
override void Initialize()