package fanch.multijeu.findwords.data;

import android.support.annotation.NonNull;

import java.io.Serializable;

import fanch.multijeu.common.core.Word;

public class WordPair implements Comparable<WordPair>, Serializable {
    public Word first=new Word();
    public WordState second;


    public WordPair() {
    }

    public WordPair(Word first) {
        this.first=first;
    }

    public WordPair(Word first, WordState second) {
        this.first=first;
        this.second=second;

    }



    @Override
    public int compareTo(@NonNull WordPair tWordPair) {
        int me = first.length();
        int o = tWordPair.first.length();
        if(me==o) return 0;
        if(me<o) return -1;
        return 1;
    }

    public String toString()
    {
        return "('"+first+"', "+second.toString()+")\n";
    }


}
