newSprites = new Vector(entitySprites); newSpriteIds = new Hashtable(entitySpriteIds); newSprites.removeElement(sprite);
newSprites = new ArrayList<Sprite>(entitySprites); newSpriteIds = new HashMap<Integer, Sprite>(entitySpriteIds); newSprites.remove(sprite);
    public void redrawMovingEntity(Entity entity, Coords position, int facing) {        Integer entityId = new Integer(entity.getId());        EntitySprite sprite = (EntitySprite) entitySpriteIds.get(entityId);        Vector newSprites;        Hashtable newSpriteIds;        if (sprite != null) {            newSprites = new Vector(entitySprites);            newSpriteIds = new Hashtable(entitySpriteIds);            newSprites.removeElement(sprite);            entitySprites = newSprites;            entitySpriteIds = newSpriteIds;        }        MovingEntitySprite mSprite =                (MovingEntitySprite) movingEntitySpriteIds.get(entityId);        newSprites = new Vector(movingEntitySprites);        newSpriteIds = new Hashtable(movingEntitySpriteIds);        if (mSprite != null) {            newSprites.removeElement(mSprite);        }        if (entity.getPosition() != null) {            mSprite = new MovingEntitySprite(entity, position, facing);            newSprites.addElement(mSprite);            newSpriteIds.put(entityId, mSprite);        }        movingEntitySprites = newSprites;        movingEntitySpriteIds = newSpriteIds;    }