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

Public Member Functions

void SetOwner (FactionBranch _branch)
 
void GainExp (int a)
 
int GetSortVal (UIList.SortMode m)
 
void WriteNote (UINote n)
 
void OnComplete ()
 
void ParseReward (UINote n=null)
 

Static Public Member Functions

static ResearchPlan Create (string id)
 
- 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)
 

Public Attributes

string id
 
int exp
 
int lastExp
 
int rank = 1
 
FactionBranch branch
 

Properties

SourceResearch.Row source [get]
 
string Name [get]
 
int MaxExp [get]
 
bool IsComplete [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 Attributes inherited from EClass
static Core core
 

Detailed Description

Definition at line 7 of file ResearchPlan.cs.

Member Function Documentation

◆ Create()

static ResearchPlan ResearchPlan.Create ( string  id)
inlinestatic

Definition at line 131 of file ResearchPlan.cs.

132 {
133 return new ResearchPlan
134 {
135 id = id
136 };
137 }

Referenced by ResearchManager.AddPlan(), and ResearchManager.ShowNewPlans().

◆ GainExp()

void ResearchPlan.GainExp ( int  a)
inline

Definition at line 36 of file ResearchPlan.cs.

37 {
38 exp += a;
39 if (exp > MaxExp)
40 {
41 exp = MaxExp;
42 }
43 }

References exp, and MaxExp.

◆ GetSortVal()

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

Definition at line 45 of file ResearchPlan.cs.

46 {
47 if (IsComplete)
48 {
49 return 0;
50 }
51 return -10;
52 }

References IsComplete.

Referenced by LayerTech.RefreshTech(), and LayerHome.RefreshTech().

◆ OnComplete()

void ResearchPlan.OnComplete ( )
inline

Definition at line 65 of file ResearchPlan.cs.

66 {
68 }
void ParseReward(UINote n=null)
Definition: ResearchPlan.cs:70

References ParseReward().

Referenced by ResearchManager.CompletePlan().

◆ ParseReward()

void ResearchPlan.ParseReward ( UINote  n = null)
inline

Definition at line 70 of file ResearchPlan.cs.

71 {
72 bool flag = n == null;
73 string reward = source.reward;
74 if (reward.IsEmpty())
75 {
76 return;
77 }
78 string[] array = reward.Split(Environment.NewLine.ToCharArray());
79 string text = array[0];
80 string[] array2 = array;
81 foreach (string text2 in array2)
82 {
83 if (text2.Split(',')[0].ToInt() <= rank)
84 {
85 text = text2;
86 }
87 }
88 List<string> list = text.Split(',').ToList();
89 list.RemoveAt(0);
90 foreach (string item in list)
91 {
92 string[] array3 = item.Split('/');
93 string text3 = "";
94 switch (array3[0])
95 {
96 case "r":
97 text3 = "rewardRecipe".lang(EClass.sources.cards.map[array3[1]].GetName());
98 if (flag)
99 {
100 EClass.player.recipes.Add(array3[1]);
101 }
102 break;
103 case "p":
104 text3 = "rewardPolicy".lang(EClass.sources.elements.alias[array3[1]].GetName());
105 if (flag)
106 {
107 branch.policies.AddPolicy(array3[1]);
108 }
109 break;
110 case "e":
111 {
112 Element element = Element.Create(array3[1], array3[2].ToInt());
113 text3 = "rewardElement".lang(EClass.sources.elements.alias[array3[1]].GetName(), array3[2]);
114 if (flag)
115 {
116 branch.AddFeat(element.id, element.Value);
117 }
118 break;
119 }
120 case "department":
121 text3 = "rewardDepartment".lang(source.GetName());
122 break;
123 }
124 if (n != null)
125 {
126 n.AddText(text3);
127 }
128 }
129 }
Definition: EClass.cs:5
static SourceManager sources
Definition: EClass.cs:42
static Player player
Definition: EClass.cs:12
int id
Definition: ELEMENT.cs:240
int Value
Definition: ELEMENT.cs:282
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:913
void AddFeat(int ele, int v)
PolicyManager policies
RecipeManager recipes
Definition: Player.cs:898
void AddPolicy(string id)
void Add(string id, bool showEffect=true)
FactionBranch branch
Definition: ResearchPlan.cs:21
SourceResearch.Row source
Definition: ResearchPlan.cs:23
Dictionary< string, CardRow > map
Definition: SourceCard.cs:8
SourceCard cards
SourceElement elements
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113

References RecipeManager.Add(), FactionBranch.AddFeat(), PolicyManager.AddPolicy(), branch, SourceManager.cards, Element.Create(), SourceManager.elements, Element.id, item, SourceCard.map, EClass.player, FactionBranch.policies, rank, Player.recipes, source, EClass.sources, and Element.Value.

Referenced by OnComplete(), and WriteNote().

◆ SetOwner()

void ResearchPlan.SetOwner ( FactionBranch  _branch)
inline

Definition at line 31 of file ResearchPlan.cs.

32 {
33 branch = _branch;
34 }

References branch.

Referenced by ResearchManager.AddPlan(), and ResearchManager.SetOwner().

◆ WriteNote()

void ResearchPlan.WriteNote ( UINote  n)
inline

Definition at line 54 of file ResearchPlan.cs.

55 {
56 n.Clear();
57 n.AddHeader(Name);
58 n.AddText("vRank".lang() + rank + " (" + Mathf.Clamp(exp * 100 / MaxExp, 0, 100) + "%)");
59 n.AddText("vMaxRank".lang() + source.maxLv);
60 n.AddHeader("researchEffect");
61 ParseReward(n);
62 n.Build();
63 }
void Clear()
Definition: UINote.cs:35
UIItem AddHeader(string text, Sprite sprite=null)
Definition: UINote.cs:79
void Build()
Definition: UINote.cs:49

References UINote.AddHeader(), UINote.AddText(), UINote.Build(), UINote.Clear(), exp, MaxExp, Name, ParseReward(), rank, and source.

Referenced by ItemResearch.SetPlan().

Member Data Documentation

◆ branch

FactionBranch ResearchPlan.branch

Definition at line 21 of file ResearchPlan.cs.

Referenced by ParseReward(), and SetOwner().

◆ exp

int ResearchPlan.exp

Definition at line 13 of file ResearchPlan.cs.

Referenced by GainExp(), UIHomeInfo.RefreshReport(), and WriteNote().

◆ id

string ResearchPlan.id

Definition at line 10 of file ResearchPlan.cs.

◆ lastExp

int ResearchPlan.lastExp

Definition at line 16 of file ResearchPlan.cs.

◆ rank

int ResearchPlan.rank = 1

Property Documentation

◆ IsComplete

bool ResearchPlan.IsComplete
get

Definition at line 29 of file ResearchPlan.cs.

Referenced by GetSortVal().

◆ MaxExp

int ResearchPlan.MaxExp
get

Definition at line 27 of file ResearchPlan.cs.

Referenced by GainExp(), UIHomeInfo.RefreshReport(), and WriteNote().

◆ Name

◆ source


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