Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
RankedZoneManager Class Reference
Inheritance diagram for RankedZoneManager:
EClass

Public Member Functions

int GetIncome (Zone z)
 
string GetRankText (Zone z)
 
int GetRank (Zone z)
 
List< RankedZoneGetList ()
 

Additional Inherited Members

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

Member Function Documentation

◆ GetIncome()

int RankedZoneManager.GetIncome ( Zone  z)
inline

Definition at line 6 of file RankedZoneManager.cs.

7 {
8 List<FactionBranch> children = EClass.pc.faction.GetChildren();
9 children.Sort((FactionBranch a, FactionBranch b) => GetRank(a.owner) - GetRank(b.owner));
10 int num = children.IndexOf(z.branch);
11 return CalcIncome(z) * 100 / (100 + num * 40);
12 int CalcIncome(Zone _z)
13 {
14 int rank = GetRank(_z);
15 if (rank > 125)
16 {
17 return 0;
18 }
19 return (126 - rank) * 100;
20 }
21 }
Faction faction
Definition: Chara.cs:412
Definition: EClass.cs:5
static Chara pc
Definition: EClass.cs:14
List< FactionBranch > GetChildren()
Definition: FACTION.cs:200
Definition: Zone.cs:12
FactionBranch branch
Definition: Zone.cs:34

References Zone.branch, Chara.faction, Faction.GetChildren(), GetRank(), FactionBranch.owner, and EClass.pc.

Referenced by Faction.GetRankIncome(), UIHomeInfo.RefreshInfo(), and UIFactionInfo.SetZone().

◆ GetList()

List< RankedZone > RankedZoneManager.GetList ( )
inline

Definition at line 47 of file RankedZoneManager.cs.

48 {
49 List<RankedZone> list = new List<RankedZone>();
50 foreach (Spatial z in EClass.game.spatials.map.Values)
51 {
52 if ((z.source.value <= 0 || z.lv != 0) && !z.IsPlayerFaction)
53 {
54 continue;
55 }
56 int v = 0;
57 if (z.IsPlayerFaction)
58 {
59 v = (z as Zone).branch.Worth;
60 }
61 else
62 {
63 v = z.source.value;
64 Rand.UseSeed(z.uid, delegate
65 {
66 v = z.source.value + EClass.rnd(z.source.value / 10);
67 });
68 }
69 list.Add(new RankedZone
70 {
71 z = (z as Zone),
72 value = v
73 });
74 }
75 list.Sort((RankedZone a, RankedZone b) => b.Value - a.Value);
76 int num = 0;
77 int num2 = 0;
78 foreach (RankedZone item in list)
79 {
80 int num3 = num2 - item.value;
81 int num4 = 1000;
82 num4 = ((item.value < 100000000) ? ((item.value < 10000000) ? ((item.value < 5000000) ? ((item.value < 1000000) ? ((item.value < 500000) ? ((item.value < 100000) ? ((item.value < 50000) ? ((item.value < 10000) ? 1000 : 2000) : 5000) : 10000) : 50000) : 500000) : 1000000) : 5000000) : 100000000);
83 num = (item.rank = num + Mathf.Max(num3 / num4, 1));
84 num2 = item.Value;
85 }
86 return list;
87 }
static Game game
Definition: EClass.cs:8
static int rnd(int a)
Definition: EClass.cs:50
SpatialManager spatials
Definition: Game.cs:152
Definition: Rand.cs:4
static void UseSeed(int seed, Action action)
Definition: Rand.cs:22
GlobalSpatialList map
int lv
Definition: Spatial.cs:142
int uid
Definition: Spatial.cs:70
bool IsPlayerFaction
Definition: Spatial.cs:443
SourceZone.Row source
Definition: Spatial.cs:441

References EClass.game, Spatial.IsPlayerFaction, Spatial.lv, SpatialManager.map, EClass.rnd(), Spatial.source, Game.spatials, Spatial.uid, and Rand.UseSeed().

Referenced by GetRank(), and ContentHomeRanking.Refresh().

◆ GetRank()

int RankedZoneManager.GetRank ( Zone  z)
inline

Definition at line 35 of file RankedZoneManager.cs.

36 {
37 foreach (RankedZone item in GetList())
38 {
39 if (item.z == z)
40 {
41 return item.rank;
42 }
43 }
44 return 1;
45 }
List< RankedZone > GetList()

References GetList(), and item.

Referenced by GetIncome(), GetRankText(), and HomeResourceWorth.UpdateRank().

◆ GetRankText()

string RankedZoneManager.GetRankText ( Zone  z)
inline

Definition at line 23 of file RankedZoneManager.cs.

24 {
25 int rank = GetRank(z);
26 string[] list = Lang.GetList("num_rank");
27 int num = rank % 10;
28 if (num >= list.Length)
29 {
30 num = 0;
31 }
32 return rank + list[num];
33 }
Definition: Lang.cs:6
static string[] GetList(string id)
Definition: Lang.cs:114

References Lang.GetList(), and GetRank().

Referenced by UIHomeInfo.RefreshInfo(), UIFactionInfo.SetZone(), and HomeResourceWorth.UpdateRank().


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