is in team

This commit is contained in:
GordonDaFreeman 2017-09-20 18:40:31 +02:00
parent 563aed745a
commit 5cae13a0c4
2 changed files with 12 additions and 0 deletions

View File

@ -8,4 +8,12 @@ public class Team {
Spieler[] spieler = new Spieler[10]; Spieler[] spieler = new Spieler[10];
Torwart torwart; Torwart torwart;
int siege; int siege;
public boolean isInTeam(Person p){
for(Person pp:spieler){
if(p.equals(pp)) return true;
}
if(torwart.equals(p)) return true;
return false;
}
} }

View File

@ -14,4 +14,8 @@ public abstract class Person {
public Team getTeam(){ public Team getTeam(){
return team; return team;
} }
public boolean isInTeam(Person p){
return team.isInTeam(p);
}
} }