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.

19 lines
428 B

  1. package de.fd.fh;
  2. public class FigureBishop extends Figure
  3. {
  4. @Override
  5. public boolean moveAllowed(int src, int dst, Figure[] field)
  6. {
  7. if ((dst-src) % Figure.fieldLength == 0) // nach oben/unten nicht erlaubt
  8. {
  9. return false;
  10. }
  11. if ((dst-src) % 7 != 0
  12. && (dst-src) % 9 != 0)
  13. return false;
  14. return super.moveAllowed(src, dst, field);
  15. }
  16. }