Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
HappinessManager.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using Newtonsoft.Json;
3
4public class HappinessManager : EClass
5{
6 [JsonProperty]
7 public List<Happiness> list = new List<Happiness>();
8
10
11 public Happiness residents => list[0];
12
14
15 public void SetOwner(FactionBranch _owner)
16 {
17 owner = _owner;
18 if (list.Count == 0)
19 {
20 for (int i = 0; i < 4; i++)
21 {
22 list.Add(new Happiness
23 {
24 value = 50,
25 lastValue = 50
26 });
27 }
28 }
29 for (int j = 0; j < 4; j++)
30 {
31 list[j].SetOwner(owner, j.ToEnum<FactionMemberType>());
32 }
33 }
34
35 public void OnSimulateDay()
36 {
37 foreach (Happiness item in list)
38 {
39 item.OnAdvanceDay();
40 }
41 }
42}
FactionMemberType
Definition: EClass.cs:5
void SetOwner(FactionBranch _owner)
FactionBranch owner
List< Happiness > list