Elin Decompiled Documentation EA 23.321 Nightly Patch 1
Loading...
Searching...
No Matches
BaseCard Class Reference
Inheritance diagram for BaseCard:
EClass Card Chara Thing

Public Member Functions

bool GetBool (int id)
 
void SetBool (int id, bool enable)
 
int GetInt (int id, int? defaultInt=null)
 
void AddInt (int id, int value)
 
void SetInt (int id, int value=0)
 
string GetStr (int id, string defaultStr=null)
 
void SetStr (int id, string value=null)
 
GetObj< T > (int id)
 
void SetObj (int id, object o)
 
SetObj< T > (int id, object o)
 

Public Attributes

Dictionary< int, object > mapObj = new Dictionary<int, object>()
 
Dictionary< int, int > mapInt = new Dictionary<int, int>()
 
Dictionary< int, string > mapStr = new Dictionary<int, string>()
 

Additional Inherited Members

- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (long a)
 
static int rnd (int a)
 
static int curve (long _a, int start, int step, int rate=75)
 
static int sqrt (int a)
 
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
 
- 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 BaseCard.cs.

Member Function Documentation

◆ AddInt()

void BaseCard.AddInt ( int  id,
int  value 
)
inline

Definition at line 30 of file BaseCard.cs.

31 {
32 SetInt(id, GetInt(id) + value);
33 }
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
void SetInt(int id, int value=0)
Definition: BaseCard.cs:35

References GetInt(), and SetInt().

◆ GetBool()

bool BaseCard.GetBool ( int  id)
inline

Definition at line 15 of file BaseCard.cs.

16 {
17 return GetInt(id) != 0;
18 }

References GetInt().

◆ GetInt()

int BaseCard.GetInt ( int  id,
int?  defaultInt = null 
)
inline

Definition at line 25 of file BaseCard.cs.

26 {
27 return mapInt.GetValueOrDefault(id, defaultInt.GetValueOrDefault());
28 }
Dictionary< int, int > mapInt
Definition: BaseCard.cs:10

References mapInt.

Referenced by AddInt(), and GetBool().

◆ GetObj< T >()

T BaseCard.GetObj< T > ( int  id)
inline

Definition at line 64 of file BaseCard.cs.

65 {
66 if (mapObj == null)
67 {
68 return default(T);
69 }
70 object valueOrDefault = mapObj.GetValueOrDefault(id);
71 if (valueOrDefault is T)
72 {
73 return (T)valueOrDefault;
74 }
75 return default(T);
76 }
Dictionary< int, object > mapObj
Definition: BaseCard.cs:7

References mapObj.

◆ GetStr()

string BaseCard.GetStr ( int  id,
string  defaultStr = null 
)
inline

Definition at line 47 of file BaseCard.cs.

48 {
49 return mapStr.GetValueOrDefault(id, defaultStr);
50 }
Dictionary< int, string > mapStr
Definition: BaseCard.cs:13

References mapStr.

◆ SetBool()

void BaseCard.SetBool ( int  id,
bool  enable 
)
inline

Definition at line 20 of file BaseCard.cs.

21 {
22 SetInt(id, enable ? 1 : 0);
23 }

References SetInt().

◆ SetInt()

void BaseCard.SetInt ( int  id,
int  value = 0 
)
inline

Definition at line 35 of file BaseCard.cs.

36 {
37 if (value == 0)
38 {
39 mapInt.Remove(id);
40 }
41 else
42 {
43 mapInt[id] = value;
44 }
45 }

References mapInt.

Referenced by AddInt(), and SetBool().

◆ SetObj()

void BaseCard.SetObj ( int  id,
object  o 
)
inline

Definition at line 78 of file BaseCard.cs.

79 {
80 if (mapObj == null)
81 {
82 mapObj = new Dictionary<int, object>();
83 }
84 if (o == null)
85 {
86 mapObj.Remove(id);
87 }
88 else
89 {
90 mapObj[id] = o;
91 }
92 }

References mapObj.

◆ SetObj< T >()

T BaseCard.SetObj< T > ( int  id,
object  o 
)
inline

Definition at line 94 of file BaseCard.cs.

95 {
96 if (mapObj == null)
97 {
98 mapObj = new Dictionary<int, object>();
99 }
100 if (o == null)
101 {
102 mapObj.Remove(id);
103 return default(T);
104 }
105 mapObj[id] = o;
106 return (T)o;
107 }

References mapObj.

◆ SetStr()

void BaseCard.SetStr ( int  id,
string  value = null 
)
inline

Definition at line 52 of file BaseCard.cs.

53 {
54 if (value.IsEmpty())
55 {
56 mapStr.Remove(id);
57 }
58 else
59 {
60 mapStr[id] = value;
61 }
62 }

References mapStr.

Member Data Documentation

◆ mapInt

Dictionary<int, int> BaseCard.mapInt = new Dictionary<int, int>()

Definition at line 10 of file BaseCard.cs.

Referenced by Card.Duplicate(), GetInt(), and SetInt().

◆ mapObj

Dictionary<int, object> BaseCard.mapObj = new Dictionary<int, object>()

◆ mapStr

Dictionary<int, string> BaseCard.mapStr = new Dictionary<int, string>()

Definition at line 13 of file BaseCard.cs.

Referenced by Card.Duplicate(), GetStr(), and SetStr().


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