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

package de.fd.fh;
public class FigureKing extends Figure
{
@Override
public boolean moveAllowed(int src, int dst, Figure[] field)
{
// TODO: Positionierung in einer Ecke beachten
if (dst != src-1
&& dst != src +1
&& dst != src -8
&& dst != src -8 -1
&& dst != src -8 +1
&& dst != src +8
&& dst != src +8 -1
&& dst != src +8 +1)
{
return false;
}
return super.moveAllowed(src, dst, field);
}
}