Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
SourceLang< T > Class Template Reference
Inheritance diagram for SourceLang< T >:
SourceData< T, string >

Public Member Functions

override T GetRow (string id)
 
string Get (string id)
 
string TryGetId (string id, string id2)
 
string Parse (string idLang, string val1, string val2=null, string val3=null, string val4=null)
 
- Public Member Functions inherited from SourceData< T, string >
override void Init ()
 
virtual void Init ()
 
virtual void OnInit ()
 
virtual void SetRow (T row)
 
override void Reset ()
 
virtual void Reset ()
 
override bool ImportData (ISheet sheet, string bookname, bool overwrite=false)
 
virtual bool ImportData (ISheet sheet, string bookname, bool overwrite=false)
 
virtual void OnAfterImportData ()
 
virtual T CreateRow ()
 
override void BackupSource ()
 
virtual void BackupSource ()
 
override void RollbackSource ()
 
virtual void RollbackSource ()
 
List< string > GetListString ()
 
SourceData< T, T2 > BuildEditorList ()
 
List< FieldInfo > GetFields ()
 
virtual T GetRow (string id)
 
override void ExportTexts (string path, bool update=false)
 
virtual void ExportTexts (string path, bool update=false)
 
override void ValidateLang ()
 
virtual void ValidateLang ()
 
override void ImportTexts (string _nameSheet=null)
 
virtual void ImportTexts (string _nameSheet=null)
 
void BuildFlags (string rawText, Dictionary< string, bool > map)
 
virtual void InsertData (IRow row)
 
virtual string[] GetList (string id)
 
virtual void BackupPref ()
 
virtual void RestorePref ()
 
virtual void ValidatePref ()
 

Properties

override bool AllowHotInitialization [get]
 
- Properties inherited from SourceData< T, string >
virtual bool AllowHotInitialization [get]
 
virtual string[] ImportFields [get]
 
virtual string sheetName [get]
 
virtual string sourcePath [get]
 
static IRow row [get, set]
 
static IRow rowDefault [get, set]
 

Additional Inherited Members

- Public Types inherited from SourceData< T, string >
enum  AutoID
 
- Static Public Member Functions inherited from SourceData< T, string >
static ICell GetCell (int x, int y)
 
static bool IsNull (ICell cell)
 
static int GetInt (int id)
 
static bool GetBool (int id)
 
static double GetDouble (int id)
 
static float GetFloat (int id)
 
static float[] GetFloatArray (int id)
 
static int[] GetIntArray (int id)
 
static string[] GetStringArray (int id)
 
static string GetString (int id)
 
static string GetStr (int id, bool useDefault=false)
 
- Public Attributes inherited from SourceData< T, string >
List< T > rows
 
Dictionary< T2, T > map
 
Dictionary< string, T > alias
 
bool initialized
 
List< string > editorListString
 
AutoID autoID
 
bool isNew
 
string nameSheet
 
string nameBook
 
- Static Public Attributes inherited from SourceData< T, string >
static ISheet currentSheet
 
static string LangSuffix
 
static string dataPath
 

Detailed Description

Type Constraints
T :LangRow 

Definition at line 3 of file SourceLang.cs.

Member Function Documentation

◆ Get()

string SourceLang< T >.Get ( string  id)
inline

Definition at line 12 of file SourceLang.cs.

13 {
14 T val = map.TryGetValue(id);
15 if (val == null)
16 {
17 return id;
18 }
19 if (!Lang.isBuiltin)
20 {
21 if (val.text_L.IsEmpty() && !val.text.IsEmpty())
22 {
23 return val.text;
24 }
25 return val.text_L;
26 }
27 if (!Lang.isJP)
28 {
29 return val.text;
30 }
31 return val.text_JP;
32 }
Definition: Lang.cs:6
static bool isBuiltin
Definition: Lang.cs:42
static bool isJP
Definition: Lang.cs:38
Dictionary< T2, T > map
Definition: SourceData.cs:63

References Lang.isBuiltin, Lang.isJP, and SourceData< T, string >.map.

Referenced by Lang.Get(), ClassExtension.langGame(), ZoneEventPhone.OnTickRound(), and SourceLang< T >.Parse().

◆ GetRow()

override T SourceLang< T >.GetRow ( string  id)
inlinevirtual

Reimplemented from SourceData< T, string >.

Definition at line 7 of file SourceLang.cs.

8 {
9 return map.TryGetValue(id);
10 }

References SourceData< T, string >.map.

◆ Parse()

string SourceLang< T >.Parse ( string  idLang,
string  val1,
string  val2 = null,
string  val3 = null,
string  val4 = null 
)
inline

Definition at line 43 of file SourceLang.cs.

44 {
45 StringBuilder stringBuilder = new StringBuilder(Get(idLang));
46 stringBuilder.Replace("#1", val1 ?? "");
47 if (val2 != null)
48 {
49 stringBuilder.Replace("#2", val2);
50 }
51 if (val3 != null)
52 {
53 stringBuilder.Replace("#3", val3);
54 }
55 if (val4 != null)
56 {
57 stringBuilder.Replace("#4", val4);
58 }
59 return stringBuilder.ToString();
60 }
string Get(string id)
Definition: SourceLang.cs:12

References SourceLang< T >.Get().

Referenced by ClassExtension.langGame().

◆ TryGetId()

string SourceLang< T >.TryGetId ( string  id,
string  id2 
)
inline

Definition at line 34 of file SourceLang.cs.

35 {
36 if (map.TryGetValue(id) == null)
37 {
38 return id2;
39 }
40 return id;
41 }

References SourceData< T, string >.map.

Referenced by Card.Say().

Property Documentation

◆ AllowHotInitialization

override bool SourceLang< T >.AllowHotInitialization
get

Definition at line 5 of file SourceLang.cs.


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