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.

38 lines
1.1 KiB

  1. package de.fd.fh;
  2. public class Game
  3. {
  4. public Figure[] mField;
  5. public static final int whiteRowOther = 0;
  6. public static final int whiteRowFarmer = 1;
  7. public static final int blackRowOther = 6;
  8. public static final int blackRowFarmer = 7;
  9. public void initNewGame()
  10. {
  11. mField = new Figure[Figure.fieldLength * Figure.fieldLength];
  12. // Figuren platzieren
  13. for (int i = 0; i < Figure.fieldLength; i++) // row
  14. {
  15. if (i == Game.whiteRowOther
  16. || i == Game.blackRowOther)
  17. {
  18. for (int j = 0; j < Figure.fieldLength; j++) // col
  19. {
  20. mField[i * Figure.fieldLength + j] = new Figure();
  21. }
  22. }
  23. if (i == Game.whiteRowFarmer
  24. || i == Game.blackRowFarmer)
  25. {
  26. for (int j = 0; j < Figure.fieldLength; j++) // col
  27. {
  28. mField[i * Figure.fieldLength + j] = new FigureFarmer();
  29. }
  30. }
  31. }
  32. }
  33. }