9 public override IEnumerable<
AIAct.Status> Run()
16 for (
int i = 0; i < this.recipe.ingredients.Count; i = num2 + 1)
21 if (ing.thing ==
null)
25 if (ing.thing ==
null || ing.thing.isDestroyed)
28 yield
return this.Cancel();
30 if (!this.HoldingResource(ing))
32 yield
return base.DoGrab(ing.thing,
this.reqs[i],
false,
null);
34 if (this.target ==
null)
39 Point blockPos =
null;
40 this.pos.ForeachMultiSize(this.recipe.W,
this.recipe.H, delegate(
Point p,
bool main)
42 if (p.HasObj && !p.HasMinableBlock && !
this.recipe.tileType.AllowObj)
46 if (p.HasBlock && !
this.recipe.tileType.CanBuiltOnBlock)
64 yield
return base.Do(
new TaskCut
70 yield
return base.DoGoto(this.pos, this.destDist, this.destIgnoreConnection,
null);
74 yield
return base.DoGoto(this.target,
null);
76 if (this.reqs[i] > 0 && this.HoldingResource(ing))
78 int num = Mathf.Min(this.reqs[i], this.owner.held.Num);
80 this.resources.Add(this.owner.SplitHeld(num) as
Thing);
81 this.owner.PlaySound(
"build_resource", 1f,
true);
96 return this.owner !=
null && this.owner.held !=
null && this.owner.held.id == ing.id && (ing.mat == -1 || this.owner.held.material.id == ing.mat) && (ing.refVal == -1 ||
this.owner.held.refVal == ing.refVal);
106 public List<Thing> resources;