예제 #1
0
def add_entity(world, entity):
    pt = entities.get_position(entity)
    if within_bounds(world, pt):
        old_entity = occ_grid.get_cell(world.occupancy, pt)
        if old_entity != None:
            entities.clear_pending_actions(old_entity)
        occ_grid.set_cell(world.occupancy, pt, entity)
        world.entities.append(entity)
예제 #2
0
def add_entity(world, entity):
   pt = entities.get_position(entity)
   if within_bounds(world, pt):
      old_entity = occ_grid.get_cell(world.occupancy, pt)
      if old_entity != None:
         entities.clear_pending_actions(old_entity)
      occ_grid.set_cell(world.occupancy, pt, entity)
      world.entities.append(entity)
예제 #3
0
 def add_entity(self, entity):
    pt = entity.get_position()
    if self.within_bounds(pt):
       old_entity = occ_grid.Grid.get_cell(self.occupancy, pt)
       if old_entity != None:
          entities.clear_pending_actions(old_entity)
       occ_grid.Grid.set_cell(self.occupancy, pt, entity)
       self.entities.append(entity)
예제 #4
0
 def add_entity(self, entity):
    pt = entity.get_position()
    if self.within_bounds(pt):
       old_entity = self.occupancy.get_cell(pt)
       if old_entity != None:
          entities.clear_pending_actions(old_entity)
       self.occupancy.set_cell(pt, entity)
       self.entities.append(entity)
예제 #5
0
 def remove_entity(world, entity):
     for action in entities.get_pending_actions(entity):
         unschedule_action(world, action)
     entities.clear_pending_actions(entity)
     remove_entity(world, entity)
예제 #6
0
 def remove_entity(world, entity):
     for action in entities.get_pending_actions(entity):
        unschedule_action(world, action)
     entities.clear_pending_actions(entity)
     remove_entity(world, entity)
예제 #7
0
def clear_pending_actions(world, entity):
   for action in entities.get_pending_actions(entity):
      worldmodel.unschedule_action(world, action)
   entities.clear_pending_actions(entity)
예제 #8
0
def clear_pending_actions(world, entity):
    for action in entities.get_pending_actions(entity):
        worldmodel.unschedule_action(world, action)
    entities.clear_pending_actions(entity)