package resources; import java.util.AbstractMap; import java.util.Map; public class ResultBySelectingA { private HandsB handsB; private HandsA handsA; private Map.Entry<Boolean, Map.Entry<Integer, Integer>> value; public ResultBySelectingA(HandsB handsB, HandsA handsA) { this.handsB = handsB; this.handsA = handsA; } public void selectAndAttackA(int attacker, int target, int guess) { this.value = new AbstractMap.SimpleEntry<>((handsB.getValue().get(target).getKey() == guess), new AbstractMap.SimpleEntry<>(target, attacker)); this.handsA.updateSucceedSelectA(value); this.handsB.updateSucceedSelectA(value); } public Map.Entry<Boolean, Map.Entry<Integer, Integer>> getValue() { return value; } }