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

Public Member Functions

void SetOwner (FactionBranch _branch)
 
void OnAdvanceHour (VirtualDate date)
 
void RefreshEffect (UINote note=null)
 
void ModHappiness (int a, FactionMemberType type, UINote note)
 
void WriteNote (UINote n)
 
int GetSortVal (UIList.SortMode m)
 

Public Attributes

int id
 
int days
 
bool active
 
FactionBranch branch
 

Properties

Element Ele [get]
 
SourceElement.Row source [get]
 
string Name [get]
 
Sprite Sprite [get]
 
int Next [get]
 
int Cost [get]
 
- 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]
 

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
 

Detailed Description

Definition at line 118 of file POLICY.cs.

Member Function Documentation

◆ GetSortVal()

int Policy.GetSortVal ( UIList::SortMode  m)
inline

Definition at line 200 of file POLICY.cs.

201 {
202 return 0;
203 }

Referenced by ContentPolicy.RefreshPolicyList(), and LayerPolicy.RefreshPolicyList().

◆ ModHappiness()

void Policy.ModHappiness ( int  a,
FactionMemberType  type,
UINote  note 
)
inline

Definition at line 173 of file POLICY.cs.

174 {
175 if ((bool)note)
176 {
177 note.AddText("peHappiness".lang(("member" + type).lang(), a.ToString() ?? "").TagColorGoodBad(() => a >= 0));
178 }
179 else
180 {
181 branch.happiness.list[(int)type].modPolicy += a;
182 }
183 }
HappinessManager happiness
List< Happiness > list
FactionBranch branch
Definition: POLICY.cs:129

References UINote.AddText(), branch, FactionBranch.happiness, and HappinessManager.list.

Referenced by RefreshEffect().

◆ OnAdvanceHour()

void Policy.OnAdvanceHour ( VirtualDate  date)
inline

Definition at line 148 of file POLICY.cs.

149 {
150 EClass._zone.elements.ModExp(id, 10);
151 }
Definition: EClass.cs:5
static Zone _zone
Definition: EClass.cs:20
void ModExp(int ele, int a, bool chain=false)
ElementContainerZone elements
Definition: Zone.cs:43

References EClass._zone, Zone.elements, and ElementContainer.ModExp().

◆ RefreshEffect()

void Policy.RefreshEffect ( UINote  note = null)
inline

Definition at line 153 of file POLICY.cs.

154 {
155 switch (source.alias)
156 {
157 case "humanRight":
158 ModHappiness(20, FactionMemberType.Default, note);
159 ModHappiness(-10, FactionMemberType.Livestock, note);
160 break;
161 case "nocturnalLife":
162 ModHappiness(-20, FactionMemberType.Default, note);
163 break;
164 case "inquisition":
165 break;
166 case "legalDrug":
167 break;
168 case "prohibition":
169 break;
170 }
171 }
FactionMemberType
void ModHappiness(int a, FactionMemberType type, UINote note)
Definition: POLICY.cs:173
SourceElement.Row source
Definition: POLICY.cs:133

References ModHappiness(), and source.

Referenced by PolicyManager.RefreshEffects().

◆ SetOwner()

void Policy.SetOwner ( FactionBranch  _branch)
inline

Definition at line 143 of file POLICY.cs.

144 {
145 branch = _branch;
146 }

References branch.

Referenced by PolicyManager.AddPolicy().

◆ WriteNote()

void Policy.WriteNote ( UINote  n)
inline

Definition at line 185 of file POLICY.cs.

186 {
187 if (Ele == null)
188 {
189 Debug.Log(id);
190 return;
191 }
193 if (active)
194 {
195 n.Space();
196 n.AddText("activeFor".lang(days.ToString() ?? ""));
197 }
198 }
void WriteNote(UINote n, ElementContainer owner=null, Action< UINote > onWriteNote=null)
Definition: ELEMENT.cs:574
Element Ele
Definition: POLICY.cs:131
bool active
Definition: POLICY.cs:127
int days
Definition: POLICY.cs:124
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113
void Space(int sizeY=0, int sizeX=1)
Definition: UINote.cs:62

References EClass._zone, active, UINote.AddText(), days, Debug, Ele, Zone.elements, UINote.Space(), and Element.WriteNote().

Referenced by ContentPolicy.RefreshPolicyList(), and LayerPolicy.RefreshPolicyList().

Member Data Documentation

◆ active

◆ branch

FactionBranch Policy.branch

Definition at line 129 of file POLICY.cs.

Referenced by ModHappiness(), and SetOwner().

◆ days

int Policy.days

Definition at line 124 of file POLICY.cs.

Referenced by WriteNote().

◆ id

int Policy.id

Definition at line 121 of file POLICY.cs.

Referenced by PolicyManager.AddPolicy(), and ContentPolicy.RefreshPolicyList().

Property Documentation

◆ Cost

int Policy.Cost
get

◆ Ele

Element Policy.Ele
get

Definition at line 131 of file POLICY.cs.

Referenced by WriteNote().

◆ Name

string Policy.Name
get

Definition at line 135 of file POLICY.cs.

Referenced by ContentPolicy.RefreshPolicyList(), and LayerPolicy.RefreshPolicyList().

◆ Next

int Policy.Next
get

Definition at line 139 of file POLICY.cs.

◆ source

◆ Sprite

Sprite Policy.Sprite
get

Definition at line 137 of file POLICY.cs.


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