package ch.usi.inf.ajp22.flyable;

/**
 * 4 Points
 * Let the class implement Flyable and Comparable<Flyable>.
 * The comparison should be done using the method getSpeed.
 */
public class Wizard extends People implements Flyable, Comparable<Flyable> {

    private int speed;
    public Wizard(String name, int age) {
        super(name, age);
        this.speed = 100;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    @Override
    public void fly() {
        System.out.println("Check broom and fly");
    }

    @Override
    public int getSpeed() {
        return speed;
    }

    @Override
    public int compareTo(Flyable o) {
        return this.speed - o.getSpeed();
    }
}
