Esempio n. 1
0
        private void Init(List <IntVec3> cells, Map map)
        {
            foreach (IntVec3 cell in cells)
            {
                _cacheCell[cell] = new CellStorage(cell, _comp);
                foreach (Thing thing in cell.GetThingList(map))
                {
                    // There is a chance that when an item with size larger than one is used as input,
                    // and the item is not supposed to be stored to this building, a corpse clips a meat hook, e.g..
                    // Thus, ThingListAt() is not the appropriate method to use here.
                    if (thing.Position != cell)
                    {
                        continue;
                    }

                    if (thing.def.EverStorable(false) && _settings.AllowedToAccept(thing))
                    {
                        this.Add(thing);
                    }
                }
            }
        }
Esempio n. 2
0
 public bool TryGetCellStorage(IntVec3 position, out CellStorage model)
 {
     return(_cacheCell.TryGetValue(position, out model));
 }