Untitled

 avatar
unknown
java
a year ago
341 B
1
Indexable
package piezas;

public class Rey extends Piezas {
    public Rey(String color) {
        super("Rey", color);
    }

    @Override
    public boolean esMovimientoValido(int origenX, int origenY, int destinoX, int destinoY) {
    
        return Math.abs(destinoX - origenX) <= 1 && Math.abs(destinoY - origenY) <= 1;
    }
}

Leave a Comment