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