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.
17 lines
408 B
17 lines
408 B
package de.fd.fh;
|
|
|
|
public class FigureFarmer extends Figure
|
|
{
|
|
@Override
|
|
public boolean moveAllowed(int src, int dst, int[] field)
|
|
{
|
|
int stepSize = src / fieldLength - dst / fieldLength; // hoch/runter
|
|
|
|
if (stepSize > 1) // weißer Bauer nicht mehr als 1 Schritt nach "oben"
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return super.moveAllowed(src, dst, field);
|
|
}
|
|
}
|