Newer
Older
Algolike / src / main / java / resources / SucceedDrawA.java
Shinji on 9 Aug 2022 854 bytes コードの整形
package resources;


import java.util.AbstractMap;
import java.util.List;
import java.util.Map;

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;
    }
}