コード例 #1
0
ファイル: Team.java プロジェクト: GertjanEnHarald/Platworm3.2
 /**
  * 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;
 }