Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ReligionManager.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using System.Linq;
3using Newtonsoft.Json;
4
5public class ReligionManager : EClass
6{
7 public Dictionary<string, Religion> dictAll = new Dictionary<string, Religion>();
8
9 public List<Religion> list = new List<Religion>();
10
11 [JsonProperty]
13
14 [JsonProperty]
16
17 [JsonProperty]
19
20 [JsonProperty]
22
23 [JsonProperty]
25
26 [JsonProperty]
28
29 [JsonProperty]
31
32 [JsonProperty]
34
35 [JsonProperty]
37
38 [JsonProperty]
40
41 [JsonProperty]
43
44 [JsonProperty]
46
47 [JsonProperty]
49
50 public void SetOwner()
51 {
52 list = new List<Religion>
53 {
56 };
57 foreach (Religion item in list)
58 {
59 dictAll.Add(item.id, item);
60 }
61 }
62
63 public void OnCreateGame()
64 {
65 SetOwner();
66 foreach (Religion item in list)
67 {
68 item.Init();
69 }
70 }
71
72 public void OnLoad()
73 {
74 SetOwner();
75 foreach (Religion value in dictAll.Values)
76 {
77 value.OnLoad();
78 }
79 }
80
81 public Religion Find(string id)
82 {
83 foreach (Religion value in dictAll.Values)
84 {
85 if (value.id == id)
86 {
87 return value;
88 }
89 }
90 return null;
91 }
92
93 public Religion GetRandomReligion(bool onlyJoinable = true, bool includeMinor = false)
94 {
95 return list.Where((Religion a) => (!onlyJoinable || a.CanJoin) && (includeMinor || !a.IsMinorGod)).RandomItem();
96 }
97}
Definition: EClass.cs:5
ReligionWind Wind
ReligionOblivion Oblivion
ReligionHarvest Harvest
Religion Find(string id)
ReligionMachine Machine
ReligionEyth Eyth
ReligionLuck Luck
ReligionStrife Strife
Dictionary< string, Religion > dictAll
ReligionHarmony Harmony
ReligionMoonShadow MoonShadow
ReligionTrickery Trickery
ReligionElement Element
List< Religion > list
ReligionEarth Earth
ReligionHealing Healing
Religion GetRandomReligion(bool onlyJoinable=true, bool includeMinor=false)
virtual bool IsMinorGod
Definition: Religion.cs:50
virtual string id
Definition: Religion.cs:26
void OnLoad()
Definition: Religion.cs:64
virtual bool CanJoin
Definition: Religion.cs:52