Elin Decompiled Documentation EA 23.268 Nightly
Loading...
Searching...
No Matches
BottleMessageList Class Reference

Static Public Member Functions

static void Init ()
 
static BookList.Item GetRandomItem ()
 
static BookList.Item GetItem (string id)
 

Static Public Attributes

static List< BookList.Itemlist
 

Detailed Description

Definition at line 4 of file BottleMessageList.cs.

Member Function Documentation

◆ GetItem()

static BookList.Item BottleMessageList.GetItem ( string  id)
inlinestatic

Definition at line 43 of file BottleMessageList.cs.

44 {
45 Init();
46 return list.First((BookList.Item p) => p.id == id) ?? list[0];
47 }
static List< BookList.Item > list
static void Init()

◆ GetRandomItem()

static BookList.Item BottleMessageList.GetRandomItem ( )
inlinestatic

Definition at line 37 of file BottleMessageList.cs.

38 {
39 Init();
40 return list.RandomItemWeighted((BookList.Item p) => p.chance);
41 }

Referenced by TraitParchmentBottle.OnCreate().

◆ Init()

static void BottleMessageList.Init ( )
inlinestatic

Definition at line 8 of file BottleMessageList.cs.

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 }
item3. title
Definition: UIBook.cs:616
Definition: Lang.cs:6
static string[] GetDialog(string idSheet, string idTopic)
Definition: Lang.cs:217

References Lang.GetDialog(), list, and title.

Member Data Documentation

◆ list

List<BookList.Item> BottleMessageList.list
static

Definition at line 6 of file BottleMessageList.cs.

Referenced by Init().


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