Elin Decompiled Documentation EA 23.268 Nightly
Loading...
Searching...
No Matches
BottleMessageList.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using System.Linq;
3
4public class BottleMessageList
5{
6 public static List<BookList.Item> list;
7
8 public static void Init()
9 {
10 if (list == null)
11 {
12 list = new List<BookList.Item>();
13 string[] dialog = Lang.GetDialog("rumor", "bottle");
14 int num = 0;
15 string[] array = dialog;
16 for (int i = 0; i < array.Length; i++)
17 {
18 string[] array2 = array[i].Split('|');
19 list.Add(new BookList.Item
20 {
21 id = (num.ToString() ?? ""),
22 author = array2[0],
23 title = array2[1],
24 lines = new string[4]
25 {
26 "",
27 "",
28 "{center}",
29 array2[2]
30 }
31 });
32 num++;
33 }
34 }
35 }
36
38 {
39 Init();
40 return list.RandomItemWeighted((BookList.Item p) => p.chance);
41 }
42
43 public static BookList.Item GetItem(string id)
44 {
45 Init();
46 return list.First((BookList.Item p) => p.id == id) ?? list[0];
47 }
48}
item3. title
Definition: UIBook.cs:616
static BookList.Item GetRandomItem()
static List< BookList.Item > list
static BookList.Item GetItem(string id)
static void Init()
Definition: Lang.cs:6
static string[] GetDialog(string idSheet, string idTopic)
Definition: Lang.cs:217