You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.1 KiB
39 lines
1.1 KiB
package de.fd.fh;
|
|
|
|
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 < Figure.fieldLength; i++) // row
|
|
{
|
|
if (i == Game.whiteRowOther
|
|
|| i == Game.blackRowOther)
|
|
{
|
|
for (int j = 0; j < Figure.fieldLength; j++) // col
|
|
{
|
|
mField[i * Figure.fieldLength + j] = new Figure();
|
|
}
|
|
}
|
|
|
|
for (int j = 0; j < Figure.fieldLength; j++) // col
|
|
{
|
|
mField[Game.whiteRowFarmer * Figure.fieldLength + j] = new FigureFarmer(0);
|
|
}
|
|
|
|
for (int j = 0; j < Figure.fieldLength; j++) // col
|
|
{
|
|
mField[Game.blackRowFarmer * Figure.fieldLength + j] = new FigureFarmer(1);
|
|
}
|
|
}
|
|
}
|
|
}
|