update
This commit is contained in:
parent
189afc5a66
commit
91f15c4809
|
|
@ -13,6 +13,7 @@ public class Spiel {
|
|||
Team heimteam;
|
||||
Team auswärtsteam;
|
||||
Schiedsrichter schiri;
|
||||
Ball b;
|
||||
//true = heim | false = auswärts
|
||||
boolean ballBesitz;
|
||||
|
||||
|
|
@ -41,6 +42,14 @@ public class Spiel {
|
|||
ballteam = auswärtsteam;
|
||||
nichtballteam = heimteam;
|
||||
}
|
||||
for(Spieler s:ballteam.spieler){
|
||||
double d = s.geschwindigkeit;
|
||||
if(s.hasBall()) d-=1;
|
||||
s.p.moveTo(nichtballteam.torwart.p, d);
|
||||
}
|
||||
for(Spieler s:nichtballteam.spieler){
|
||||
s.p.moveTo(b.s.p, s.geschwindigkeit);
|
||||
}
|
||||
}
|
||||
|
||||
private void attackPhase(){
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
package fußballmanager.personen;
|
||||
|
||||
public class Ball{
|
||||
Person p;
|
||||
public Spieler s;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ public class Spieler extends Person {
|
|||
int verteidigung;
|
||||
int tore;
|
||||
int motivation;
|
||||
double geschwindigkeit;
|
||||
Position p;
|
||||
public double geschwindigkeit;
|
||||
public Position p;
|
||||
Ball b;
|
||||
|
||||
public void setBall(Ball b){
|
||||
|
|
@ -40,4 +40,9 @@ public class Spieler extends Person {
|
|||
this.vorname = Datenbank.genVorname();
|
||||
this.name = Datenbank.genName();
|
||||
}
|
||||
|
||||
public boolean hasBall() {
|
||||
if(b!=null) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue