def add(self,o): self.checkHold(o) if o.location(): o.location().remove(o) o.location = getP(self) p = getP(o) if o not in self.contains: self.contains.append(p)
def add(self,o,slot=None): if not slot: Container.add(self,o) return self.checkHoldSlot(o,slot) if slot in self.slots: other = self.slots[slot]() self.add(other) if o.location: o.location().remove(o) self.slots[slot] = getP(o) o.location = getP(self) o.locationSlot = slot
def schedule(self,o): for itemQueue in self.itemQueues.values(): if o.id in itemQueue: del itemQueue[o.id] queue = o.ticksPerTurn if queue: if queue not in self.itemQueues: self.itemQueues[queue] = {} self.itemQueues[queue][o.id] = getP(o)