Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
Version Struct Reference

Public Member Functions

string GetText ()
 
int GetInt ()
 
int GetInt (int _major, int _minor, int _batch)
 
bool IsBelow (int _major, int _minor, int _batch)
 
bool IsBelow (Version v)
 
bool IsBelow (int _int)
 
bool IsSaveCompatible (Version v)
 
override bool Equals (object obj)
 
override int GetHashCode ()
 

Static Public Member Functions

static Version Get (string str)
 
static Version Get (int i)
 

Public Attributes

int major
 
int minor
 
int batch
 
int fix
 
bool demo
 

Detailed Description

Definition at line 4 of file Version.cs.

Member Function Documentation

◆ Equals()

override bool Version.Equals ( object  obj)
inline

Definition at line 86 of file Version.cs.

87 {
88 Version version = (Version)obj;
89 if (version.major == major && version.minor == minor)
90 {
91 return version.batch == batch;
92 }
93 return false;
94 }
int batch
Definition: Version.cs:10
int major
Definition: Version.cs:6
int minor
Definition: Version.cs:8

References batch, major, and minor.

◆ Get() [1/2]

static Version Version.Get ( int  i)
inlinestatic

Definition at line 64 of file Version.cs.

65 {
66 Version result = default(Version);
67 result.major = i / 1000000;
68 result.minor = i / 1000 % 1000;
69 result.batch = i % 1000;
70 return result;
71 }

◆ Get() [2/2]

static Version Version.Get ( string  str)
inlinestatic

Definition at line 46 of file Version.cs.

47 {
48 if (str.IsEmpty())
49 {
50 return default(Version);
51 }
52 string[] array = str.Split('.');
53 if (array.Length < 3)
54 {
55 return default(Version);
56 }
57 Version result = default(Version);
58 result.major = array[0].ToInt();
59 result.minor = array[1].ToInt();
60 result.batch = array[2].ToInt();
61 return result;
62 }

Referenced by MapMetaData.IsValidVersion(), Net.DownloadMeta.IsValidVersion(), and BaseModPackage.IsValidVersion().

◆ GetHashCode()

override int Version.GetHashCode ( )
inline

Definition at line 96 of file Version.cs.

97 {
98 return GetInt();
99 }
int GetInt()
Definition: Version.cs:21

References GetInt().

◆ GetInt() [1/2]

int Version.GetInt ( )
inline

Definition at line 21 of file Version.cs.

22 {
23 return major * 1000000 + minor * 1000 + batch;
24 }

References batch, major, and minor.

Referenced by Map.ExportMetaData(), GetHashCode(), IsBelow(), Zone.OnVisit(), ModManager.ParseExtra(), LangSetting.SetVersion(), and Net.UploadFile().

◆ GetInt() [2/2]

int Version.GetInt ( int  _major,
int  _minor,
int  _batch 
)
inline

Definition at line 26 of file Version.cs.

27 {
28 return _major * 1000000 + _minor * 1000 + _batch;
29 }

◆ GetText()

string Version.GetText ( )
inline

Definition at line 16 of file Version.cs.

17 {
18 return ((minor >= 23) ? "EA" : "Beta") + " " + minor + "." + batch + ((fix == 0) ? "" : (" Patch " + fix)) + (demo ? "demo".lang() : "");
19 }
int fix
Definition: Version.cs:12
bool demo
Definition: Version.cs:14

References batch, demo, fix, and minor.

Referenced by WidgetSystemIndicator._Refresh(), Core.Awake(), SourceData< T, T2 >.ExportTexts(), WidgetFeed.OnActivate(), WidgetMainText.OnActivate(), LayerFeedback.OnInit(), LayerTitle.OnInit(), LayerLoadGame.RefreshInfo(), LayerLoadGame.RefreshList(), and CoreConfig.TryLoadConfig().

◆ IsBelow() [1/3]

bool Version.IsBelow ( int  _int)
inline

Definition at line 41 of file Version.cs.

42 {
43 return GetInt() < _int;
44 }

References GetInt().

◆ IsBelow() [2/3]

bool Version.IsBelow ( int  _major,
int  _minor,
int  _batch 
)
inline

Definition at line 31 of file Version.cs.

32 {
33 return GetInt() < GetInt(_major, _minor, _batch);
34 }

References GetInt().

Referenced by IsBelow(), IsSaveCompatible(), MapMetaData.IsValidVersion(), Net.DownloadMeta.IsValidVersion(), BaseModPackage.IsValidVersion(), and CoreConfig.TryLoadConfig().

◆ IsBelow() [3/3]

bool Version.IsBelow ( Version  v)
inline

Definition at line 36 of file Version.cs.

37 {
38 return IsBelow(v.GetInt());
39 }
bool IsBelow(int _major, int _minor, int _batch)
Definition: Version.cs:31

References GetInt(), and IsBelow().

◆ IsSaveCompatible()

bool Version.IsSaveCompatible ( Version  v)
inline

Definition at line 73 of file Version.cs.

74 {
75 if (IsBelow(v))
76 {
77 return false;
78 }
79 if (major == v.major)
80 {
81 return minor >= 21;
82 }
83 return false;
84 }

References IsBelow(), major, and minor.

Referenced by GameIO.CanLoad(), LayerLoadGame.RefreshInfo(), and LayerLoadGame.RefreshList().

Member Data Documentation

◆ batch

int Version.batch

Definition at line 10 of file Version.cs.

Referenced by Equals(), GetInt(), and GetText().

◆ demo

◆ fix

int Version.fix

Definition at line 12 of file Version.cs.

Referenced by GetText().

◆ major

int Version.major

Definition at line 6 of file Version.cs.

Referenced by Equals(), GetInt(), and IsSaveCompatible().

◆ minor

int Version.minor

Definition at line 8 of file Version.cs.

Referenced by Equals(), GetInt(), GetText(), and IsSaveCompatible().


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