package h03.robots;

public class VersatileRobot extends HackingRobot {

    public VersatileRobot(int x, int y, boolean order, boolean exchange) {
        super(x, y, order);

        if (exchange) {
            setField(y, x);
        }

        if (getType() == MovementType.DIAGONAL) {
            setY(getX());
        }
    }

    @Override
    public boolean shuffle(int itNr) {
        var changed = super.shuffle(itNr);

        if (getType() == MovementType.DIAGONAL) {
            setY(getX());
        }

        return changed;
    }

    @Override
    public void shuffle() {
        super.shuffle();

        if (getType() == MovementType.DIAGONAL) {
            setY(getX());
        }
    }
}
