|
|
|
@ -12,7 +12,7 @@ public class Province extends Actor
|
|
|
|
|
private int provinceID;
|
|
|
|
|
private String displayName;
|
|
|
|
|
private int owner;
|
|
|
|
|
private int[] nextProvinces;
|
|
|
|
|
private boolean[] nextProvinces;
|
|
|
|
|
private int continentID;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -31,11 +31,18 @@ public class Province extends Actor
|
|
|
|
|
continentID = i2;
|
|
|
|
|
stars = i3;
|
|
|
|
|
displayName = s1;
|
|
|
|
|
nextProvinces = new int[ia1.length];
|
|
|
|
|
|
|
|
|
|
for ( int z1 = 0; z1 < ia1.length; z1++)
|
|
|
|
|
{
|
|
|
|
|
nextProvinces[z1] = ia1[z1];
|
|
|
|
|
// Der Teil, der sich um die Konvertierung des int-Array in ein boolean-Array kümmert.
|
|
|
|
|
int maxNum = 0;
|
|
|
|
|
for(int i = 0; i < ia1.length(); i++) {
|
|
|
|
|
if(maxNum < ia1[i]) {
|
|
|
|
|
maxNum = ia1[i];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
nextProvinces = new boolean[ia1.length];
|
|
|
|
|
for(int i = 0; i < ia1.length(); i++) {
|
|
|
|
|
if(ia1[i] >= 0) {
|
|
|
|
|
nextProvinces = ia1[i];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -63,10 +70,12 @@ public class Province extends Actor
|
|
|
|
|
return owner;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Liefert angrenzende Provinzen als Integer-Array
|
|
|
|
|
public int[] getNextProvinces()
|
|
|
|
|
{
|
|
|
|
|
return nextProvinces;
|
|
|
|
|
// Fragt ab, ob die angegebene Provinz in der Nähe von dieser liegt.
|
|
|
|
|
public boolean isProvinceNear(int i) {
|
|
|
|
|
if(i >= nextProvinces.length()) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return nearProvinces[i];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Liefert die Kontinent-ID als Integer
|
|
|
|
|