public IEnumerable <Thing> GetThingsInCountingStockpile() { return(_countingStockpile?.GetSlotGroup()?.HeldThings); }
public void TakeInventory() { if (!this.initialized) { this.Initialize(); } this.ClearInventory(); foreach (Building current in Find.ListerBuildings.allBuildingsColonist) { this.Count(current); Building_Storage building_Storage = current as Building_Storage; if (building_Storage != null && building_Storage.GetSlotGroup() != null) { foreach (Thing current2 in building_Storage.GetSlotGroup().HeldThings) { this.Count(current2); } } InventoryResolver inventoryResolver; if (this.inventoryResolvers.TryGetValue(current.def.defName, out inventoryResolver)) { List <InventoryCount> inventoryCounts = inventoryResolver.GetInventoryCounts(current, this.state.prefs); if (inventoryCounts != null) { foreach (InventoryCount current3 in inventoryCounts) { this.Count(current3); } } } } using (List <Zone> .Enumerator enumerator4 = Find.ZoneManager.AllZones.FindAll((Zone zone) => zone is Zone_Stockpile).GetEnumerator()) { while (enumerator4.MoveNext()) { Zone_Stockpile zone_Stockpile = (Zone_Stockpile)enumerator4.Current; if (zone_Stockpile.GetSlotGroup() != null) { foreach (Thing current4 in zone_Stockpile.GetSlotGroup().HeldThings) { this.Count(current4); } } } } foreach (Pawn current5 in Find.ListerPawns.FreeColonists) { if (current5.equipment != null) { foreach (Thing current6 in current5.equipment.AllEquipment) { this.Count(current6); } } if (current5.apparel != null) { foreach (Thing current7 in current5.apparel.WornApparel) { this.Count(current7); } } if (current5.inventory != null && current5.inventory.container != null) { ThingContainer container = current5.inventory.container; int count = container.Count; for (int i = 0; i < count; i++) { this.Count(container[i]); } } } }