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

Classes

class  Data
 

Public Member Functions

void Add (Data data)
 
Data Add (string text, FontColor c)
 
Data Add (string text, string col=null)
 
List< DataGetList (bool reverse=false)
 

Public Attributes

Dictionary< int, Datadict = new Dictionary<int, Data>()
 
int currentLogIndex
 
string id
 

Properties

int maxLog [get]
 
- 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]
 

Private Member Functions

void OnSerializing (StreamingContext context)
 

Additional Inherited Members

- 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 inherited from EClass
static Core core
 

Detailed Description

Definition at line 6 of file MsgLog.cs.

Member Function Documentation

◆ Add() [1/3]

void MsgLog.Add ( Data  data)
inline

Definition at line 53 of file MsgLog.cs.

54 {
55 dict.Add(currentLogIndex, data);
58 {
59 dict.Remove(currentLogIndex - maxLog);
60 }
61 }
int maxLog
Definition: MsgLog.cs:30
int currentLogIndex
Definition: MsgLog.cs:24
Dictionary< int, Data > dict
Definition: MsgLog.cs:21

References currentLogIndex, dict, and maxLog.

Referenced by Add(), FactionBranch.LogRaw(), Msg.SayRaw(), and GameDate.ShipGoods().

◆ Add() [2/3]

Data MsgLog.Add ( string  text,
FontColor  c 
)
inline

Definition at line 63 of file MsgLog.cs.

64 {
65 return Add(text, c.ToString());
66 }
void Add(Data data)
Definition: MsgLog.cs:53

References Add().

◆ Add() [3/3]

Data MsgLog.Add ( string  text,
string  col = null 
)
inline

Definition at line 68 of file MsgLog.cs.

69 {
70 Data data = new Data
71 {
72 text = text,
73 col = col
74 };
75 data.date = (VirtualDate.current ?? EClass.world.date).Copy();
76 Add(data);
77 return data;
78 }
Definition: EClass.cs:5
static World world
Definition: EClass.cs:40
GameDate date
Definition: World.cs:6

References Add(), Copy, World.date, and EClass.world.

◆ GetList()

List< Data > MsgLog.GetList ( bool  reverse = false)
inline

Definition at line 80 of file MsgLog.cs.

81 {
82 List<Data> list = new List<Data>();
83 foreach (Data value in dict.Values)
84 {
85 list.Add(value);
86 }
87 list.Sort((Data a, Data b) => a.date.GetRaw() - b.date.GetRaw());
88 if (reverse)
89 {
90 list.Reverse();
91 }
92 return list;
93 }

References MsgLog.Data.date, dict, and Date.GetRaw().

Referenced by ContentChronicle.OnSwitchContent(), and ContentHomeLog.RefreshLog().

◆ OnSerializing()

void MsgLog.OnSerializing ( StreamingContext  context)
inlineprivate

Definition at line 42 of file MsgLog.cs.

43 {
44 foreach (int item in dict.Keys.ToList())
45 {
47 {
48 dict.Remove(item);
49 }
50 }
51 }

References currentLogIndex, dict, item, and maxLog.

Member Data Documentation

◆ currentLogIndex

int MsgLog.currentLogIndex

Definition at line 24 of file MsgLog.cs.

Referenced by Add(), and OnSerializing().

◆ dict

Dictionary<int, Data> MsgLog.dict = new Dictionary<int, Data>()

Definition at line 21 of file MsgLog.cs.

Referenced by Add(), GetList(), and OnSerializing().

◆ id

string MsgLog.id

Definition at line 27 of file MsgLog.cs.

Property Documentation

◆ maxLog

int MsgLog.maxLog
get

Definition at line 29 of file MsgLog.cs.

30 {
31 get
32 {
33 if (id == "chronicle")
34 {
35 return 9999;
36 }
37 return 50;
38 }
39 }

Referenced by Add(), and OnSerializing().


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