is in team
This commit is contained in:
parent
563aed745a
commit
5cae13a0c4
|
|
@ -8,4 +8,12 @@ public class Team {
|
|||
Spieler[] spieler = new Spieler[10];
|
||||
Torwart torwart;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,4 +14,8 @@ public abstract class Person {
|
|||
public Team getTeam(){
|
||||
return team;
|
||||
}
|
||||
|
||||
public boolean isInTeam(Person p){
|
||||
return team.isInTeam(p);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue