package resources; import java.util.AbstractMap; import java.util.List; import java.util.Map; public class ResultByDrawingB { private Deck deck; private HandsB handsB; private HandsA handsA; private Map.Entry<Boolean, Integer> value; public ResultByDrawingB(Deck deck, HandsB handsB, HandsA handsA) { this.deck = deck; this.handsB = handsB; this.handsA = handsA; } public void drawAndAttackB(int target, int guess) { 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; } }