Added Teamfill

This commit is contained in:
Delta1805 2017-09-20 20:33:20 +02:00
parent da393605aa
commit c72216d8b5
5 changed files with 39 additions and 14 deletions

View File

@ -7,7 +7,26 @@ public class Team {
Trainer trainer;
Spieler[] spieler = new Spieler[10];
Torwart torwart;
int siege;
int siege = 0;
public Team(String name){
this.name = name;
fülleTeam();
addTrainer();
}
public void fülleTeam(){
//Fülle Feldspieler
for(int i =0; i<10;i++){
spieler[i] = new Spieler();
}
//Fülle Torwart
torwart = new Torwart();
}
public void addTrainer(){
trainer = new Trainer();
}
public boolean isInTeam(Person p){
for(Person pp:spieler){

View File

@ -12,8 +12,6 @@ public abstract class Person {
this.team = team;
}
public Team getTeam(){
return team;
}

View File

@ -37,7 +37,7 @@ public class Spieler extends Person {
this.verteidigung = random;
this.stärke = 100-random;
this.geschwindigkeit = 4+Math.random()*2;
this.vorname = "Hans";
this.name = "Wurst";
this.vorname = Datenbank.genVorname();
this.name = Datenbank.genName();
}
}

View File

@ -1,5 +1,18 @@
package fußballmanager.personen;
import java.util.Random;
import fußballmanager.namegen.Datenbank;
public class Torwart extends Spieler{
public Torwart() {
int random = new Random().nextInt(100);
this.verteidigung = random;
this.stärke = 100-random;
this.geschwindigkeit = 4+Math.random()*2;
this.vorname = Datenbank.genVorname();
this.name = Datenbank.genName();
}
}

View File

@ -1,19 +1,14 @@
package fußballmanager.personen;
import fußballmanager.namegen.Datenbank;
public class Trainer extends Person{
int inspiration;
int erfahrung = 0;
public Trainer(String name, String vorname, int inspiration, int erfahrung){
this.name = name;
this.vorname = vorname;
this.inspiration = inspiration;
this.erfahrung = erfahrung;
}
public Trainer(){
this.name ="Mustertrainer";
this.vorname = "Max";
this.name = Datenbank.genName();
this.vorname = Datenbank.genVorname();
this.inspiration = (int) (Math.random()*100);
}