def remove(self, entity):
        position = self.entity_positions.pop(entity)
        self.tiles[position].detach(entity)

        if entity.isa(Player):
            del self.player
        if IPortal in entity.type.components:
            dest = IPortal(entity).destination
            del self.portal_index[dest]
dataset/ETHPy150Open eevee/flax/flax/map.py/Map.remove/original