@Override public T getNext() { final Tuple2<Node<T>, ? extends List<Node<T>>> result = stack.pop2(); final Node<T> node = result._1; stack = node.right.isEmpty() ? result._2 : pushLeftChildren(result._2, (Node<T>) node.right); return result._1.value; }
public Card dealOneCard(List<Card> stack) { Tuple2<Card, ? extends List<Card>> cardTuple2 = stack.pop2(); stack = cardTuple2._2(); return cardTuple2._1(); }
@Override public T getNext() { final Tuple2<Node<T>, ? extends List<Node<T>>> result = stack.pop2(); final Node<T> node = result._1; stack = node.right.isEmpty() ? result._2 : pushLeftChildren(result._2, (Node<T>) node.right); return result._1.value; }
public Card dealOneCard(List<Card> stack) { Tuple2<Card, List<Card>> cardTuple2 = stack.pop2(); stack = cardTuple2._2(); return cardTuple2._1(); }
public Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count) { var hand = HashSet.<Card>empty(); for (int i = 0; i < count; i++) { var cardTuple2 = stack.pop2(); stack = cardTuple2._2(); hand = hand.add(cardTuple2._1()); } return Tuple.of(hand, stack); }
public Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count) { Set<Card> hand = HashSet.empty(); for (int i = 0; i < count; i++) { Tuple2<Card, ? extends List<Card>> cardTuple2 = stack.pop2(); stack = cardTuple2._2(); hand = hand.add(cardTuple2._1()); } return Tuple.of(hand, stack); }
public Tuple2<Set<Card>, List<Card>> deal(List<Card> stack, int count) { Set<Card> hand = HashSet.empty(); for (int i = 0; i < count; i++) { Tuple2<Card, List<Card>> cardTuple2 = stack.pop2(); stack = cardTuple2._2(); hand = hand.add(cardTuple2._1()); } return Tuple.of(hand, stack); }
public Tuple2<Set<Card>, ? extends List<Card>> deal(List<Card> stack, int count) { Set<Card> hand = HashSet.empty(); for (int i = 0; i < count; i++) { Tuple2<Card, ? extends List<Card>> cardTuple2 = stack.pop2(); stack = cardTuple2._2(); hand = hand.add(cardTuple2._1()); } return Tuple.of(hand, stack); }