package org.academiadecodigo.bootcamp11.arabiannights.genies;

/**
 * MIT License
 * (c) 2017 Ricardo Constantino
 */

public class RecyclableDemon extends Genie {
    private boolean recyclable;

    public RecyclableDemon() {
        super(0, GenieType.RECYCLABLE);
        this.recyclable = true;
    }

    @Override
    public void introduction() {
        super.introduction();
        System.out.println(this.getGenieType() + ": I can go back into the lamp and reset it.\n");
    }

    public boolean isRecyclable() {
        return this.recyclable;
    }

    public void useToRecycle() {
        this.recyclable = false;
    }

    @Override
    public void grantWish(String wish) {
        if (this.isRecyclable()) {
            grantOneWish(wish);
        } else {
            System.out.println(this.getGenieType() + ": I can't grant any more wishes.\n");
        }
    }
}
