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

Public Member Functions

string GetBuild ()
 
string GetNumeric ()
 
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
 
bool nightly
 

Detailed Description

Definition at line 5 of file Version.cs.

Member Function Documentation

◆ Equals()

override bool Version.Equals ( object  obj)
inline

Definition at line 115 of file Version.cs.

116 {
117 Version version = (Version)obj;
118 if (version.major == major && version.minor == minor)
119 {
120 return version.batch == batch;
121 }
122 return false;
123 }
int batch
Definition: Version.cs:11
int major
Definition: Version.cs:7
int minor
Definition: Version.cs:9

References batch, major, and minor.

Referenced by Game.OnLoad().

◆ Get() [1/2]

static Version Version.Get ( int  i)
inlinestatic

Definition at line 92 of file Version.cs.

93 {
94 return new Version
95 {
96 major = i / 1000000,
97 minor = i / 1000 % 1000,
98 batch = i % 1000
99 };
100 }

References batch, major, and minor.

◆ Get() [2/2]

static Version Version.Get ( string  str)
inlinestatic

Definition at line 73 of file Version.cs.

74 {
75 if (str.IsEmpty())
76 {
77 return default(Version);
78 }
79 string[] array = str.Split('.');
80 if (array.Length < 3)
81 {
82 return default(Version);
83 }
84 return new Version
85 {
86 major = array[0].ToInt(),
87 minor = array[1].ToInt(),
88 batch = array[2].ToInt()
89 };
90 }

References batch, major, and minor.

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

◆ GetBuild()

string Version.GetBuild ( )
inline

Definition at line 20 of file Version.cs.

21 {
22 if (!nightly)
23 {
24 return "Stable";
25 }
26 return "Nightly";
27 }
bool nightly
Definition: Version.cs:18

References nightly.

◆ GetHashCode()

override int Version.GetHashCode ( )
inline

Definition at line 125 of file Version.cs.

126 {
127 return GetInt();
128 }
int GetInt()
Definition: Version.cs:39

References GetInt().

◆ GetInt() [1/2]

int Version.GetInt ( )
inline

Definition at line 39 of file Version.cs.

40 {
41 return major * 1000000 + minor * 1000 + batch;
42 }

References batch, major, and minor.

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

◆ GetInt() [2/2]

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

Definition at line 44 of file Version.cs.

45 {
46 return _major * 1000000 + _minor * 1000 + _batch;
47 }

◆ GetNumeric()

string Version.GetNumeric ( )
inline

Definition at line 29 of file Version.cs.

30 {
31 return major + "." + minor + "." + batch + "." + fix;
32 }
int fix
Definition: Version.cs:13

References batch, fix, major, and minor.

◆ GetText()

string Version.GetText ( )
inline

◆ IsBelow() [1/3]

bool Version.IsBelow ( int  _int)
inline

Definition at line 68 of file Version.cs.

69 {
70 return GetInt() < _int;
71 }

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 54 of file Version.cs.

55 {
56 return IsBelow(v.GetInt());
57 }
bool IsBelow(int _major, int _minor, int _batch)
Definition: Version.cs:49

References GetInt(), and IsBelow().

◆ IsSameOrBelow()

bool Version.IsSameOrBelow ( Version  v)
inline

Definition at line 59 of file Version.cs.

60 {
61 if (v.GetInt() != GetInt())
62 {
63 return IsBelow(v.GetInt());
64 }
65 return true;
66 }

References GetInt(), and IsBelow().

Referenced by Net.DownloadMeta.IsValidVersion().

◆ IsSaveCompatible()

bool Version.IsSaveCompatible ( Version  v)
inline

Definition at line 102 of file Version.cs.

103 {
104 if (IsBelow(v))
105 {
106 return false;
107 }
108 if (major == v.major)
109 {
110 return minor >= 21;
111 }
112 return false;
113 }

References IsBelow(), major, and minor.

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

Member Data Documentation

◆ batch

int Version.batch

Definition at line 11 of file Version.cs.

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

◆ demo

◆ fix

int Version.fix

Definition at line 13 of file Version.cs.

Referenced by GetNumeric(), and GetText().

◆ major

int Version.major

Definition at line 7 of file Version.cs.

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

◆ minor

int Version.minor

Definition at line 9 of file Version.cs.

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

◆ nightly

bool Version.nightly

Definition at line 18 of file Version.cs.

Referenced by GetBuild().


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