Elin Decompiled Documentation EA 23.179 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>()
 
IngType ingType
 
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 rndSeed (int a, int seed)
 
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 20 of file Recipe.cs.

Member Function Documentation

◆ CanSetThing()

bool Recipe.Ingredient.CanSetThing ( Thing  t)
inline

Definition at line 89 of file Recipe.cs.

90 {
91 if (t.id != id || t.Num < req)
92 {
93 return false;
94 }
95 return true;
96 }
string id
Definition: Card.cs:33
int Num
Definition: Card.cs:156

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

◆ GetName()

string Recipe.Ingredient.GetName ( )
inline

Definition at line 105 of file Recipe.cs.

106 {
107 if (useCat)
108 {
109 string text = CatName(id);
110 if (idOther.Count > 0)
111 {
112 foreach (string item in idOther)
113 {
114 text = text + ", " + CatName(item);
115 }
116 }
117 return "ingCat".lang(text);
118 }
119 string text2 = EClass.sources.cards.map[id].GetName().IsEmpty(("card_" + id).lang());
120 string text3 = (tag.IsEmpty() ? "" : ("(" + ("tag_" + tag).lang() + ")"));
121 if (idOther.Count > 0)
122 {
123 foreach (string item2 in idOther)
124 {
125 text3 = text3 + ", " + EClass.sources.cards.map[item2].GetName();
126 }
127 }
128 return text2 + text3;
129 static string CatName(string id)
130 {
131 return EClass.sources.categories.map[id].GetName();
132 }
133 }
Definition: EClass.cs:5
static SourceManager sources
Definition: EClass.cs:42
List< string > idOther
Definition: Recipe.cs:41
string tag
Definition: Recipe.cs:38
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 135 of file Recipe.cs.

136 {
137 if (ingType == IngType.CreativeFood && t.HasElement(10))
138 {
139 return true;
140 }
141 if (useCat)
142 {
143 if (t.category.IsChildOf(id))
144 {
145 return true;
146 }
147 foreach (string item in idOther)
148 {
149 if (t.category.IsChildOf(item))
150 {
151 return true;
152 }
153 }
154 return false;
155 }
156 if (t.id == id || t.source._origin == id)
157 {
158 return true;
159 }
160 foreach (string item2 in idOther)
161 {
162 if (t.id == id || t.source._origin == item2)
163 {
164 return true;
165 }
166 }
167 return false;
168 }
bool HasElement(int ele, int req=1)
Definition: Card.cs:5615
SourceCategory.Row category
Definition: Card.cs:1999
IngType ingType
Definition: Recipe.cs:44
IngType
Definition: Recipe.cs:15
SourceThing.Row source
Definition: Thing.cs:11

References Card.category, Card.HasElement(), Card.id, Recipe.Ingredient.idOther, Recipe.Ingredient.ingType, item, Thing.source, and Recipe.Ingredient.useCat.

◆ RefreshThing()

Thing Recipe.Ingredient.RefreshThing ( )
inline

Definition at line 68 of file Recipe.cs.

69 {
70 if (thing == null)
71 {
73 if (thing == null)
74 {
76 if (thing == null)
77 {
79 if (thing == null)
80 {
82 }
83 }
84 }
85 }
86 return thing;
87 }
ThingContainer things
Definition: Card.cs:36
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:389
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 98 of file Recipe.cs.

99 {
100 uid = t?.uid ?? 0;
101 thing = t;
102 mat = t?.material.id ?? (-1);
103 }
SourceMaterial.Row material
Definition: Card.cs:2001
int uid
Definition: Card.cs:120

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 50 of file Recipe.cs.

◆ id

string Recipe.Ingredient.id

◆ idOther

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

◆ ingType

IngType Recipe.Ingredient.ingType

Definition at line 44 of file Recipe.cs.

Referenced by Recipe.Ingredient.IsValidIngredient().

◆ mat

int Recipe.Ingredient.mat = -1

◆ optional

bool Recipe.Ingredient.optional

Definition at line 48 of file Recipe.cs.

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

◆ refVal

int Recipe.Ingredient.refVal = -1

Definition at line 32 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 38 of file Recipe.cs.

Referenced by Recipe.Ingredient.GetName().

◆ thing

◆ uid

int Recipe.Ingredient.uid

Definition at line 23 of file Recipe.cs.

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

◆ useCat

bool Recipe.Ingredient.useCat

Definition at line 52 of file Recipe.cs.

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

Property Documentation

◆ IdThing

string Recipe.Ingredient.IdThing
get

Definition at line 56 of file Recipe.cs.

57 {
58 get
59 {
60 if (!useCat)
61 {
62 return id;
63 }
64 return EClass.sources.categories.map[id].GetIdThing();
65 }
66 }

◆ IsThingSpecified

bool Recipe.Ingredient.IsThingSpecified
get

Definition at line 54 of file Recipe.cs.

Referenced by TaskBuild._CanPerformTask().


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