|
|
@ -4,18 +4,26 @@ public class Game |
|
|
|
{ |
|
|
|
public Figure[] mField; |
|
|
|
|
|
|
|
public static final int whiteRowOther = 0; |
|
|
|
public static final int whiteRowFarmer = 1; |
|
|
|
public static final int blackRowOther = 6; |
|
|
|
public static final int blackRowFarmer = 7; |
|
|
|
|
|
|
|
public void initNewGame() |
|
|
|
{ |
|
|
|
mField = new Figure[Figure.fieldLength * Figure.fieldLength]; |
|
|
|
|
|
|
|
// Figuren platzieren |
|
|
|
for (int i = 0; i < 8; i++) // row |
|
|
|
for (int i = 0; i < Figure.fieldLength; i++) // row |
|
|
|
{ |
|
|
|
if (i == 0 || i == 1 || i == 6 || i == 7) |
|
|
|
if (i == Game.whiteRowOther |
|
|
|
|| i == Game.whiteRowFarmer |
|
|
|
|| i == Game.blackRowOther |
|
|
|
|| i == Game.blackRowFarmer) |
|
|
|
{ |
|
|
|
for (int j = 0; j < 8; j++) // col |
|
|
|
for (int j = 0; j < Figure.fieldLength; j++) // col |
|
|
|
{ |
|
|
|
mField[i * 8 + j] = new Figure(); |
|
|
|
mField[i * Figure.fieldLength + j] = new Figure(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|