Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
NewsList Class Reference
Inheritance diagram for NewsList:
EClass

Classes

class  Item
 

Static Public Member Functions

static void Init ()
 
static List< ItemGetNews (int seed)
 
- Static Public Member Functions inherited from EClass
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 

Static Public Attributes

static Dictionary< string, List< Item > > dict
 
static List< ItemlistAll = new List<Item>()
 
- Static Public Attributes inherited from EClass
static Core core
 

Additional Inherited Members

- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 4 of file NewsList.cs.

Member Function Documentation

◆ GetNews()

static List< Item > NewsList.GetNews ( int  seed)
inlinestatic

Definition at line 80 of file NewsList.cs.

81 {
82 Init();
84 List<Item> list = new List<Item>();
85 for (int i = 0; i < 1000; i++)
86 {
87 Item item = listAll.RandomItem();
88 if (!list.Contains(item))
89 {
90 list.Add(item);
91 if (list.Count >= 3)
92 {
93 break;
94 }
95 }
96 }
97 Rand.SetSeed();
98 return list;
99 }
@ seed
static void Init()
Definition: NewsList.cs:19
static List< Item > listAll
Definition: NewsList.cs:17
Definition: Rand.cs:4
static void SetSeed(int a=-1)
Definition: Rand.cs:37

References Init(), item, listAll, seed, and Rand.SetSeed().

Referenced by LayerNewspaper.RefreshNews().

◆ Init()

static void NewsList.Init ( )
inlinestatic

Definition at line 19 of file NewsList.cs.

20 {
21 if (dict == null)
22 {
23 dict = new Dictionary<string, List<Item>>();
24 listAll.Clear();
26 }
27 static void AddDir(string path)
28 {
29 DirectoryInfo directoryInfo = new DirectoryInfo(path);
30 Item item = null;
31 FileInfo[] files = directoryInfo.GetFiles();
32 foreach (FileInfo fileInfo in files)
33 {
34 if (!(fileInfo.Extension != ".txt"))
35 {
36 string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileInfo.Name);
37 List<Item> list = dict.TryGetValue(fileNameWithoutExtension);
38 StreamReader streamReader = new StreamReader(fileInfo.FullName);
39 string text = null;
40 while (!streamReader.EndOfStream)
41 {
42 string text2 = streamReader.ReadLine();
43 if (!string.IsNullOrEmpty(text2))
44 {
45 if (text2.StartsWith('@') && item != null)
46 {
47 string[] array = text2.TrimStart('@').Split(',');
48 foreach (string item2 in array)
49 {
50 item.listImageId.Add(item2);
51 }
52 }
53 else if (text == null)
54 {
55 text = text2;
56 }
57 else
58 {
59 item = new Item
60 {
61 title = text,
62 content = text2
63 };
64 if (list == null)
65 {
66 list = new List<Item>();
67 dict.Add(fileNameWithoutExtension, list);
68 }
69 list.Add(item);
70 listAll.Add(item);
71 text = null;
72 }
73 }
74 }
75 }
76 }
77 }
78 }
item3. title
Definition: UIBook.cs:616
static string News
Definition: CorePath.cs:79
static Dictionary< string, List< Item > > dict
Definition: NewsList.cs:15

References dict, item, listAll, CorePath.CorePackage.News, and title.

Referenced by GetNews().

Member Data Documentation

◆ dict

Dictionary<string, List<Item> > NewsList.dict
static

Definition at line 15 of file NewsList.cs.

Referenced by Init().

◆ listAll

List<Item> NewsList.listAll = new List<Item>()
static

Definition at line 17 of file NewsList.cs.

Referenced by GetNews(), Init(), and LayerNewspaper.RefreshNews().


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