implemented namegen into person

This commit is contained in:
Delta1805 2017-09-20 19:43:30 +02:00
parent 7c96cc9403
commit 0ff1d30dba
2 changed files with 23 additions and 6 deletions

View File

@ -3,12 +3,12 @@ package fu
public class Datenbank { public class Datenbank {
int n = 100; int n = 100;
int counterName = 0; public int counterName = 0;
int counterVorname = 0; public int counterVorname = 0;
int counterBeiname = 0; public int counterBeiname = 0;
String[] nameFeld; public String[] nameFeld;
String[] vornameFeld; public String[] vornameFeld;
String[] beinameFeld; public String[] beinameFeld;
public Datenbank(){ public Datenbank(){
nameFeld = new String[n]; nameFeld = new String[n];

View File

@ -1,6 +1,7 @@
package fußballmanager.personen; package fußballmanager.personen;
import fußballmanager.Team; import fußballmanager.Team;
import fußballmanager.namegen.Datenbank;
public abstract class Person { public abstract class Person {
int alter; int alter;
@ -11,6 +12,22 @@ public abstract class Person {
this.team = team; this.team = team;
} }
public String genName(){
String r = "";
Datenbank data = new Datenbank();
data.nameFeldFüllen();
data.nameFeld[(int) (Math.random() * data.counterVorname)];
}
public String genVorname(Datenbank d){
String r = "";
Datenbank data = new Datenbank();
data.nameFeldFüllen();
data.vornameFeld[(int) (Math.random() * data.counterVorname)];
}
public Team getTeam(){ public Team getTeam(){
return team; return team;
} }