Newer
Older
Algolike / src / main / java / resources / SucceedDrawB.java
package resources;

import java.util.*;

public class SucceedDrawB {
    private Deck deck;
    private HandsB handsB;
    private HandsA handsA;
    private Map.Entry<Boolean, Integer> value;

    public SucceedDrawB(Deck deck, HandsB handsB, HandsA handsA) {
        this.deck = deck;
        this.handsB = handsB;
        this.handsA = handsA;
    }

    public void inputDrawB(int guess, int target) {
        this.value = new AbstractMap.SimpleEntry<>((handsA.getValue().get(target).getKey() == guess), target);

        List deck = this.deck.getValue();
        this.handsB.updateSucceedDrawB(value, deck);
        this.handsA.updateSucceedDrawB(value, deck);
        this.deck.updateSucceedDrawB(value);
    }

    public Map.Entry<Boolean, Integer> getValue() {
        return value;
    }
}