Team class
This commit is contained in:
@@ -27,14 +27,15 @@ public class Team {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* TODO Facade: addWormsToTeam(Team team, Worm... worms)
|
|
||||||
*
|
*
|
||||||
* @param worm
|
* @param worm
|
||||||
*/
|
*/
|
||||||
public void addWormsToTeam(Worm worm) {
|
public void addWormsToTeam(Worm... worm) {
|
||||||
if (canHaveAsWorm(worm)) {
|
for (Worm w: worm) {
|
||||||
team.add(worm);
|
if (canHaveAsWorm(w)) {
|
||||||
sortList(team);
|
team.add(w);
|
||||||
|
sortList(team);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,12 +62,13 @@ public class Team {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* TODO Facade: removeWormsFromTeam(Team team, Worm... worms)
|
|
||||||
*
|
*
|
||||||
* @param worm
|
* @param worm
|
||||||
*/
|
*/
|
||||||
public void removeWormsFromTeam(Worm worm) {
|
public void removeWormsFromTeam(Worm... worm) {
|
||||||
team.remove(worm);
|
for (Worm w: worm) {
|
||||||
|
team.remove(w);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user