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

Public Member Functions

void Clear ()
 
void SetRecipe (Recipe r)
 
bool CanExecute ()
 
void Execute ()
 

Public Attributes

int money
 
int count
 
int countValid
 
Recipe recipe
 
List< IInspecttargets = new List<IInspect>()
 
List< InspectGroupgroups = new List<InspectGroup>()
 
Thing factory
 
bool hasFactory
 

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
 
- 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]
 

Detailed Description

Definition at line 4 of file HitSummary.cs.

Member Function Documentation

◆ CanExecute()

bool HitSummary.CanExecute ( )
inline

Definition at line 44 of file HitSummary.cs.

45 {
47 {
48 return true;
49 }
51 {
52 return false;
53 }
55 {
56 return true;
57 }
58 if (recipe != null)
59 {
60 if (!recipe.UseStock)
61 {
62 Dictionary<Thing, int> dictionary = new Dictionary<Thing, int>();
63 foreach (Recipe.Ingredient ingredient in recipe.ingredients)
64 {
65 if (ingredient.thing != null)
66 {
67 if (!dictionary.ContainsKey(ingredient.thing))
68 {
69 dictionary.Add(ingredient.thing, 0);
70 }
71 dictionary[ingredient.thing] += ingredient.req * countValid;
72 }
73 }
74 foreach (KeyValuePair<Thing, int> item in dictionary)
75 {
76 if (item.Key.Num < item.Value)
77 {
78 return false;
79 }
80 }
81 foreach (Recipe.Ingredient ingredient2 in recipe.ingredients)
82 {
83 if (!ingredient2.optional)
84 {
85 if (ingredient2.thing == null)
86 {
87 return false;
88 }
89 if (ingredient2.thing.Num < ingredient2.req * countValid)
90 {
91 return false;
92 }
93 }
94 }
95 }
96 else if (recipe.ingredients[0].thing == null || recipe.ingredients[0].thing.Num < countValid)
97 {
98 return false;
99 }
100 }
101 return true;
102 }
BaseTileSelector tileSelector
int GetCurrency(string id="money")
Definition: Card.cs:3652
bool ignoreBuildRule
Definition: CoreDebug.cs:184
Definition: EClass.cs:5
static BaseGameScreen screen
Definition: EClass.cs:32
static Chara pc
Definition: EClass.cs:14
static CoreDebug debug
Definition: EClass.cs:48
int countValid
Definition: HitSummary.cs:10
int money
Definition: HitSummary.cs:6
Recipe recipe
Definition: HitSummary.cs:12
bool hasFactory
Definition: HitSummary.cs:20
Definition: Recipe.cs:7
List< Ingredient > ingredients
Definition: Recipe.cs:164
bool UseStock
Definition: Recipe.cs:167

References countValid, EClass.debug, Card.GetCurrency(), hasFactory, CoreDebug.ignoreBuildRule, Recipe.ingredients, item, money, EClass.pc, BaseTileSelector.processing, recipe, EClass.screen, BaseGameScreen.tileSelector, and Recipe.UseStock.

◆ Clear()

void HitSummary.Clear ( )
inline

Definition at line 22 of file HitSummary.cs.

23 {
24 money = (count = (countValid = 0));
25 targets.Clear();
26 groups.Clear();
28 }
void SetRecipe(Recipe r)
Definition: HitSummary.cs:30
int count
Definition: HitSummary.cs:8
List< InspectGroup > groups
Definition: HitSummary.cs:16
List< IInspect > targets
Definition: HitSummary.cs:14

References count, countValid, groups, money, recipe, SetRecipe(), and targets.

Referenced by BaseTileSelector.RefreshSummary().

◆ Execute()

void HitSummary.Execute ( )
inline

Definition at line 104 of file HitSummary.cs.

105 {
107 {
109 }
110 if (recipe == null || (recipe.UseStock && !recipe.VirtualBlock))
111 {
112 return;
113 }
115 {
117 }
119 {
120 return;
121 }
122 foreach (Recipe.Ingredient ingredient in recipe.ingredients)
123 {
124 Thing thing = (recipe.UseStock ? recipe.ingredients[0].thing : ingredient.RefreshThing());
125 if (thing == null)
126 {
127 if (!EClass.debug.enable)
128 {
129 Debug.LogError("no ing");
130 }
131 break;
132 }
133 int num = ingredient.req * countValid;
134 int num2 = ((thing.Num >= num) ? num : thing.Num);
136 {
137 thing.ModNum(-num2);
138 }
139 }
140 }
static BuildMenu Instance
Definition: BuildMenu.cs:77
UIRecipeInfo info1
Definition: BuildMenu.cs:27
void ModCurrency(int a, string id="money")
Definition: Card.cs:3638
int Num
Definition: Card.cs:154
void ModNum(int a, bool notify=true)
Definition: Card.cs:3262
bool enable
Definition: CoreDebug.cs:285
bool godBuild
Definition: CoreDebug.cs:303
static Player player
Definition: EClass.cs:12
bool instaComplete
Definition: Player.cs:956
string id
Definition: Recipe.cs:161
virtual bool RequireIngredients
Definition: Recipe.cs:263
virtual TileType tileType
Definition: Recipe.cs:198
bool VirtualBlock
Definition: Recipe.cs:173
Definition: Thing.cs:8
virtual bool CanInstaComplete
Definition: TileType.cs:199
Dictionary< string, int > lastMats
Definition: UIRecipeInfo.cs:69

References TileType.CanInstaComplete, countValid, EClass.debug, Debug, CoreDebug.enable, CoreDebug.godBuild, Recipe.id, CoreDebug.ignoreBuildRule, BuildMenu.info1, Recipe.ingredients, Player.instaComplete, BuildMenu.Instance, UIRecipeInfo.lastMats, Card.ModCurrency(), Card.ModNum(), money, Card.Num, EClass.pc, EClass.player, recipe, Recipe.RequireIngredients, Recipe.tileType, Recipe.UseStock, and Recipe.VirtualBlock.

Referenced by BaseTileSelector.ExecuteSummary().

◆ SetRecipe()

void HitSummary.SetRecipe ( Recipe  r)
inline

Definition at line 30 of file HitSummary.cs.

31 {
32 recipe = r;
33 hasFactory = true;
34 if (r != null && !r.UseStock && r.source.NeedFactory)
35 {
36 PropSet propSet = EClass._map.Installed.cardMap.TryGetValue(r.source.idFactory);
37 if ((propSet == null || propSet.Count == 0) && EClass.pc.things.Find((Thing t) => t.id == r.source.idFactory) == null)
38 {
39 hasFactory = false;
40 }
41 }
42 }
string id
Definition: Card.cs:31
ThingContainer things
Definition: Card.cs:34
static Map _map
Definition: EClass.cs:18
PropsInstalled Installed
Definition: Map.cs:123
Dictionary< string, PropSet > cardMap
Definition: Props.cs:10
string idFactory
Definition: RecipeSource.cs:85
bool NeedFactory
Definition: RecipeSource.cs:61
RecipeSource source
Definition: Recipe.cs:187
Thing Find(int uid)

References EClass._map, Props.cardMap, ThingContainer.Find(), hasFactory, Card.id, RecipeSource.idFactory, Map.Installed, RecipeSource.NeedFactory, EClass.pc, recipe, Recipe.source, Card.things, and Recipe.UseStock.

Referenced by Clear().

Member Data Documentation

◆ count

int HitSummary.count

Definition at line 8 of file HitSummary.cs.

Referenced by Clear(), and AM_Designation< T >.OnRefreshSummary().

◆ countValid

◆ factory

Thing HitSummary.factory

Definition at line 18 of file HitSummary.cs.

Referenced by UIRecipeInfo.RefreshBalance().

◆ groups

List<InspectGroup> HitSummary.groups = new List<InspectGroup>()

Definition at line 16 of file HitSummary.cs.

Referenced by Clear().

◆ hasFactory

bool HitSummary.hasFactory

Definition at line 20 of file HitSummary.cs.

Referenced by CanExecute(), and SetRecipe().

◆ money

int HitSummary.money

◆ recipe

Recipe HitSummary.recipe

Definition at line 12 of file HitSummary.cs.

Referenced by CanExecute(), Clear(), Execute(), and SetRecipe().

◆ targets

List<IInspect> HitSummary.targets = new List<IInspect>()

Definition at line 14 of file HitSummary.cs.

Referenced by Clear().


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