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

Public Member Functions

Thing RefreshThing ()
 
bool CanSetThing (Thing t)
 
void SetThing (Thing t=null)
 
string GetName ()
 
bool IsValidIngredient (Thing t)
 

Public Attributes

int uid
 
int req
 
int mat = -1
 
int refVal = -1
 
string id
 
string tag
 
List< string > idOther = new List<string>()
 
Thing thing
 
bool optional
 
bool dye
 
bool useCat
 

Properties

bool IsThingSpecified [get]
 
string IdThing [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 14 of file Recipe.cs.

Member Function Documentation

◆ CanSetThing()

bool Recipe.Ingredient.CanSetThing ( Thing  t)
inline

Definition at line 80 of file Recipe.cs.

81 {
82 if (t.id != id || t.Num < req)
83 {
84 return false;
85 }
86 return true;
87 }
string id
Definition: Card.cs:31
int Num
Definition: Card.cs:154

References Card.id, Card.Num, and Recipe.Ingredient.req.

◆ GetName()

string Recipe.Ingredient.GetName ( )
inline

Definition at line 96 of file Recipe.cs.

97 {
98 if (useCat)
99 {
100 string text = CatName(id);
101 if (idOther.Count > 0)
102 {
103 foreach (string item in idOther)
104 {
105 text = text + ", " + CatName(item);
106 }
107 }
108 return "ingCat".lang(text);
109 }
110 string text2 = EClass.sources.cards.map[id].GetName().IsEmpty(("card_" + id).lang());
111 string text3 = (tag.IsEmpty() ? "" : ("(" + ("tag_" + tag).lang() + ")"));
112 if (idOther.Count > 0)
113 {
114 foreach (string item2 in idOther)
115 {
116 text3 = text3 + ", " + EClass.sources.cards.map[item2].GetName();
117 }
118 }
119 return text2 + text3;
120 static string CatName(string id)
121 {
122 return EClass.sources.categories.map[id].GetName();
123 }
124 }
Definition: EClass.cs:5
static SourceManager sources
Definition: EClass.cs:42
List< string > idOther
Definition: Recipe.cs:35
string tag
Definition: Recipe.cs:32
Dictionary< string, CardRow > map
Definition: SourceCard.cs:8
SourceCard cards
SourceCategory categories

References SourceManager.cards, SourceManager.categories, Recipe.Ingredient.id, Recipe.Ingredient.idOther, item, SourceCard.map, EClass.sources, Recipe.Ingredient.tag, and Recipe.Ingredient.useCat.

◆ IsValidIngredient()

bool Recipe.Ingredient.IsValidIngredient ( Thing  t)
inline

Definition at line 126 of file Recipe.cs.

127 {
128 if (useCat)
129 {
130 if (t.category.IsChildOf(id))
131 {
132 return true;
133 }
134 foreach (string item in idOther)
135 {
136 if (t.category.IsChildOf(item))
137 {
138 return true;
139 }
140 }
141 return false;
142 }
143 if (t.id == id || t.source._origin == id)
144 {
145 return true;
146 }
147 foreach (string item2 in idOther)
148 {
149 if (t.id == id || t.source._origin == item2)
150 {
151 return true;
152 }
153 }
154 return false;
155 }
SourceCategory.Row category
Definition: Card.cs:1925
SourceThing.Row source
Definition: Thing.cs:11

References Card.category, Card.id, Recipe.Ingredient.idOther, item, Thing.source, and Recipe.Ingredient.useCat.

◆ RefreshThing()

Thing Recipe.Ingredient.RefreshThing ( )
inline

Definition at line 59 of file Recipe.cs.

60 {
61 if (thing == null)
62 {
64 if (thing == null)
65 {
67 if (thing == null)
68 {
70 if (thing == null)
71 {
73 }
74 }
75 }
76 }
77 return thing;
78 }
ThingContainer things
Definition: Card.cs:34
static Map _map
Definition: EClass.cs:18
static Chara pc
Definition: EClass.cs:14
PropsStocked Stocked
Definition: Map.cs:121
Thing Find(int uid)
Definition: Props.cs:357
Thing Find(int uid)

References EClass._map, Props.Find(), ThingContainer.Find(), Recipe.Ingredient.mat, EClass.pc, Recipe.Ingredient.refVal, Map.Stocked, Recipe.Ingredient.thing, Card.things, and Recipe.Ingredient.uid.

Referenced by AI_HaulResource.Run().

◆ SetThing()

void Recipe.Ingredient.SetThing ( Thing  t = null)
inline

Definition at line 89 of file Recipe.cs.

90 {
91 uid = t?.uid ?? 0;
92 thing = t;
93 mat = t?.material.id ?? (-1);
94 }
SourceMaterial.Row material
Definition: Card.cs:1927
int uid
Definition: Card.cs:118

References Recipe.Ingredient.mat, Recipe.Ingredient.thing, and Recipe.Ingredient.uid.

Referenced by DropdownGrid.TrySelect().

Member Data Documentation

◆ dye

bool Recipe.Ingredient.dye

Definition at line 41 of file Recipe.cs.

◆ id

string Recipe.Ingredient.id

◆ idOther

List<string> Recipe.Ingredient.idOther = new List<string>()

◆ mat

int Recipe.Ingredient.mat = -1

◆ optional

bool Recipe.Ingredient.optional

Definition at line 39 of file Recipe.cs.

Referenced by Recipe.GetMaxCount(), and Recipe.IsCraftable().

◆ refVal

int Recipe.Ingredient.refVal = -1

Definition at line 26 of file Recipe.cs.

Referenced by TaskBuild._CanPerformTask(), and Recipe.Ingredient.RefreshThing().

◆ req

int Recipe.Ingredient.req

◆ tag

string Recipe.Ingredient.tag

Definition at line 32 of file Recipe.cs.

Referenced by Recipe.Ingredient.GetName().

◆ thing

◆ uid

int Recipe.Ingredient.uid

Definition at line 17 of file Recipe.cs.

Referenced by Recipe.Ingredient.RefreshThing(), and Recipe.Ingredient.SetThing().

◆ useCat

bool Recipe.Ingredient.useCat

Definition at line 43 of file Recipe.cs.

Referenced by Recipe.Ingredient.GetName(), and Recipe.Ingredient.IsValidIngredient().

Property Documentation

◆ IdThing

string Recipe.Ingredient.IdThing
get

Definition at line 47 of file Recipe.cs.

48 {
49 get
50 {
51 if (!useCat)
52 {
53 return id;
54 }
55 return EClass.sources.categories.map[id].GetIdThing();
56 }
57 }

◆ IsThingSpecified

bool Recipe.Ingredient.IsThingSpecified
get

Definition at line 45 of file Recipe.cs.

Referenced by TaskBuild._CanPerformTask().


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