/** * Returns all the worms in this team that are alive. * * @return Returns all the worms that are in this team and that are alive. | livingWorms = {} | * for each worm in getWorms() | if worm.isAlive() | then livingWorms.add(worm) | result == * livingWorms */ protected List<Worm> getLivingWorms() { List<Worm> wormsAlive = new ArrayList<Worm>(); for (Worm worm : this.getWorms()) { if (worm.isAlive()) wormsAlive.add(worm); } return wormsAlive; }