11 this.hasFactory =
true;
12 this.money = (this.count = (this.countValid = 0));
18 public void SetRecipe(
Recipe r)
21 this.hasFactory =
true;
22 if (r !=
null && !r.UseStock && r.source.NeedFactory)
24 PropSet propSet =
EClass._map.Installed.cardMap.TryGetValue(r.source.idFactory,
null);
25 if (propSet ==
null || propSet.Count == 0)
27 this.hasFactory =
false;
33 public bool CanExecute()
35 if (
EClass.debug.ignoreBuildRule)
39 if (!this.hasFactory ||
EClass.pc.GetCurrency(
"money") <
this.money)
43 if (
EClass.screen.tileSelector.processing)
47 if (this.recipe !=
null)
51 if (!ingredient.optional)
53 if (ingredient.thing ==
null)
57 if (ingredient.thing.Num < ingredient.req *
this.countValid)
71 if (!
EClass.debug.ignoreBuildRule)
73 EClass.pc.ModCurrency(-this.money,
"money");
75 if (this.recipe ==
null || (this.recipe.UseStock && !
this.recipe.VirtualBlock))
79 if (this.recipe.RequireIngredients)
81 BuildMenu.Instance.info1.lastMats[this.recipe.id] = this.recipe.ingredients[0].mat;
83 if (this.recipe.tileType.CanInstaComplete ||
EClass.player.instaComplete)
87 Thing thing = this.recipe.UseStock ? this.recipe.ingredients[0].thing : ingredient.RefreshThing();
92 Debug.LogError(
"no ing");
96 int num = ingredient.req * this.countValid;
97 int num2 = (thing.Num >= num) ? num : thing.Num;
98 if (!
EClass.debug.godBuild ||
this.recipe.UseStock)
100 thing.ModNum(-num2,
true);
113 public int countValid;
119 public List<IInspect> targets =
new List<IInspect>();
122 public List<InspectGroup> groups =
new List<InspectGroup>();
125 public Thing factory;
128 public bool hasFactory;