Elin Decompiled Documentation EA 23.130 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 IsSameOrBelow (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 95 of file Version.cs.

96 {
97 Version version = (Version)obj;
98 if (version.major == major && version.minor == minor)
99 {
100 return version.batch == batch;
101 }
102 return false;
103 }
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 73 of file Version.cs.

74 {
75 Version result = default(Version);
76 result.major = i / 1000000;
77 result.minor = i / 1000 % 1000;
78 result.batch = i % 1000;
79 return result;
80 }

◆ Get() [2/2]

static Version Version.Get ( string  str)
inlinestatic

Definition at line 55 of file Version.cs.

56 {
57 if (str.IsEmpty())
58 {
59 return default(Version);
60 }
61 string[] array = str.Split('.');
62 if (array.Length < 3)
63 {
64 return default(Version);
65 }
66 Version result = default(Version);
67 result.major = array[0].ToInt();
68 result.minor = array[1].ToInt();
69 result.batch = array[2].ToInt();
70 return result;
71 }

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

◆ GetHashCode()

override int Version.GetHashCode ( )
inline

Definition at line 105 of file Version.cs.

106 {
107 return GetInt();
108 }
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(), IsSameOrBelow(), 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 50 of file Version.cs.

51 {
52 return GetInt() < _int;
53 }

References GetInt().

◆ IsBelow() [2/3]

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

◆ 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().

◆ IsSameOrBelow()

bool Version.IsSameOrBelow ( Version  v)
inline

Definition at line 41 of file Version.cs.

42 {
43 if (v.GetInt() != GetInt())
44 {
45 return IsBelow(v.GetInt());
46 }
47 return true;
48 }

References GetInt(), and IsBelow().

Referenced by Net.DownloadMeta.IsValidVersion().

◆ IsSaveCompatible()

bool Version.IsSaveCompatible ( Version  v)
inline

Definition at line 82 of file Version.cs.

83 {
84 if (IsBelow(v))
85 {
86 return false;
87 }
88 if (major == v.major)
89 {
90 return minor >= 21;
91 }
92 return false;
93 }

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: