示例#1
0
 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)
示例#2
0
 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
示例#3
0
 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)