Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
HomeResourceManager.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using Newtonsoft.Json;
3
5{
6 [JsonProperty]
8
9 [JsonProperty]
11
12 [JsonProperty]
14
15 [JsonProperty]
17
18 [JsonProperty]
20
21 [JsonProperty]
23
24 [JsonProperty]
26
27 [JsonProperty]
29
30 [JsonProperty]
32
33 [JsonProperty]
35
36 [JsonProperty]
38
39 [JsonProperty]
41
42 [JsonProperty]
44
45 [JsonProperty]
47
49
50 public bool isDirty = true;
51
52 public List<BaseHomeResource> list;
53
54 public void SetOwner(FactionBranch _owner)
55 {
56 owner = _owner;
57 if (worth == null)
58 {
59 food = new HomeResource().Create<HomeResource>(HomeResourceType.food, 0);
60 money = new HomeResource().Create<HomeResource>(HomeResourceType.money, 0);
61 knowledge = new HomeResource().Create<HomeResource>(HomeResourceType.knowledge, 0);
62 fun = new HomeResourceFun().Create<HomeResourceFun>(HomeResourceType.fun, 50);
72 }
73 list = new List<BaseHomeResource>
74 {
77 };
78 foreach (BaseHomeResource item in list)
79 {
80 item.branch = owner;
81 }
82 }
83
84 public void SetDirty()
85 {
86 isDirty = true;
87 }
88
89 public void OnSimulateDay()
90 {
91 foreach (BaseHomeResource item in list)
92 {
93 item.OnAdvanceDay();
94 }
95 }
96
97 public void Refresh()
98 {
99 foreach (BaseHomeResource item in list)
100 {
101 item.Refresh();
102 }
103 isDirty = false;
104 }
105
106 public BaseHomeResource Get(string id)
107 {
108 return this.GetField<BaseHomeResource>(id);
109 }
110
111 public T Get<T>(string id) where T : BaseHomeResource
112 {
113 return this.GetField<T>(id);
114 }
115}
HomeResourceType
Definition: EClass.cs:5
HomeResourceKarma karma
HomeResourceReknown reknown
HomeResourceCulture culture
void SetOwner(FactionBranch _owner)
HomeResourceNature nature
HomeResourceMedicine medicine
HomeResourceEducation education
HomeResourceIndustry industry
List< BaseHomeResource > list
HomeResourceWorth worth
HomeResourceSafety safety
BaseHomeResource Get(string id)