public override void Control() { Pawns = OwnedPawns(); if (LogisticNetwork.ItemSatisfaction(_electricity) < 0.95f) { WantToBuild(_pawn, _eval); } }
public override void Control() { Pawns = OwnedPawns(); if (LogisticNetwork.ItemSatisfaction(_food) < 0.95f) { WantToBuild(_crop, _eval); } }
private void Populate() { foreach (var item in items) { LogisticNetwork.ItemSatisfaction(item, out float requested, out float satisfied); var capacity = LogisticNetwork.ItemCapacity(item).Maximum; rowPrefab.icon.sprite = item.sprite; rowPrefab.icon.SetNativeSize(); rowPrefab.name.text = item.name; requested /= G.DeltaTime; satisfied /= G.DeltaTime; rowPrefab.produced.color = satisfied < requested ? bad : good; rowPrefab.requested.text = requested.ToString("N"); rowPrefab.produced.text = satisfied.ToString("N"); rowPrefab.capacity.text = capacity.ToString("N"); Instantiate(rowPrefab, transform); } }