added isDead method to team class
This commit is contained in:
@@ -3,9 +3,6 @@ package netwerkprog.game.client.game.characters;
|
|||||||
import netwerkprog.game.util.game.GameCharacter;
|
import netwerkprog.game.util.game.GameCharacter;
|
||||||
import netwerkprog.game.util.tree.BST;
|
import netwerkprog.game.util.tree.BST;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
public class Team {
|
public class Team {
|
||||||
private BST<GameCharacter> members;
|
private BST<GameCharacter> members;
|
||||||
|
|
||||||
@@ -56,4 +53,12 @@ public class Team {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isDead() {
|
||||||
|
int dead = 0;
|
||||||
|
for (GameCharacter character : this.members) {
|
||||||
|
if (character.isDead()) dead++;
|
||||||
|
}
|
||||||
|
return dead >= this.members.getSize();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user