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


import java.util.*;

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

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

    public void inputDrawA(int guess, int target) {
        this.value = new AbstractMap.SimpleEntry<>((handsB.getValue().get(target).getKey() == guess), target);
        List deck = this.deck.getValue();
        this.handsA.updateSucceedDrawA(value, deck);
        this.handsB.updateSucceedDrawA(value, deck);
        this.deck.updateSucceedDrawA(value);
    }

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