static List updateSprite(List list, List buffer) {
        List both = list;
        if (resetSprites) {
            both.clear();
            Gui.clearText();
        }
        else {
            for (Iterator<Sprite> it = both.iterator(); it.hasNext();) {
                Sprite sprite = it.next();
                sprite.update();
                if (sprite.remove) it.remove();
            }
            both.addAll(buffer);
        }
        return both;
    }