package fanch.multijeu.findwords.data.checker;

import android.util.Log;

import fanch.multijeu.findwords.data.dictionaire.Dictionaire;
import fanch.multijeu.findwords.data.LetterGenerator;

public class RandomWordChekerList extends AbstractWordCheckerList {

    public static class Attrs extends LetterGenerator.Attrs {
        public int generationCount=10;
    }

    protected LetterGenerator.Attrs mAttrs=new LetterGenerator.Attrs();
    protected WordChecker   mLastChecker=null;


    public RandomWordChekerList()
    {
        super(null);
    }

    public RandomWordChekerList(Attrs attrs)
    {
        super(attrs);
    }


    public WordChecker getLastChecker() {
        return mLastChecker;
    }

    public void setLastChecker(WordChecker mLastChecker) {
        this.mLastChecker = mLastChecker;
    }


    @Override
    public WordChecker next(Dictionaire dico) {
        mLastChecker=WordChecker.generate(dico, mAttrs);
        Log.e("------", "Lettres : "+mLastChecker.getLetters()
                +" -> "+mLastChecker.getExpected().size()
                +" / "+mLastChecker.getBonus().size());

        return mLastChecker;
    }



    @Override
    public WordChecker peek() {
        return mLastChecker;
    }

    @Override
    public boolean hasNext() {
        return true;
    }

    @Override
    public void reset() {

    }
}
