package com.dairymoose.modernlife.blocks.gui.chess;

/* loaded from: outputsrg.jar:com/dairymoose/modernlife/blocks/gui/chess/KnightPiece.class */
public class KnightPiece extends Piece {
    @Override // com.dairymoose.modernlife.blocks.gui.chess.Piece
    public boolean canMove(int x, int y) {
        int xDiff = x - this.f9x;
        int yDiff = y - this.f10y;
        boolean forwardMotion = Math.abs(xDiff) == 1 && Math.abs(yDiff) == 2;
        boolean lateralMotion = Math.abs(xDiff) == 2 && Math.abs(yDiff) == 1;
        if (forwardMotion || lateralMotion) {
            return canDoMove(x, y);
        }
        return false;
    }

    @Override // com.dairymoose.modernlife.blocks.gui.chess.Piece
    public int getId() {
        return PieceIds.KNIGHT.ordinal();
    }
}
