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.

25 lines
577 B

  1. package de.fd.fh;
  2. public class FigureKing extends Figure
  3. {
  4. @Override
  5. public boolean moveAllowed(int src, int dst, Figure[] field)
  6. {
  7. // TODO: Positionierung in einer Ecke beachten
  8. if (dst != src-1
  9. && dst != src +1
  10. && dst != src -8
  11. && dst != src -8 -1
  12. && dst != src -8 +1
  13. && dst != src +8
  14. && dst != src +8 -1
  15. && dst != src +8 +1)
  16. {
  17. return false;
  18. }
  19. return super.moveAllowed(src, dst, field);
  20. }
  21. }