@param CardCollection $board
@param Hand           $hand

@return CardResults
196164
public static function evaluate(CardCollection $board, Hand $hand): CardResults
    {
        $cards = $board->merge($hand->cards());

        if (($result = static::royalFlush($cards)) !== false) {
            return SevenCardResult::createRoyalFlush($result, $hand);
        }

        if (($result = static::straightFlush($cards)) !== false) {
            return SevenCardResult::createStraightFlush($result, $hand);
        }

        if (($result = static::fourOfAKind($cards)) !== false) {
            return SevenCardResult::createFourOfAKind($result, $hand);
        }

        if (($result = static::fullHouse($cards)) !== false) {
            return SevenCardResult::createFullHouse($result, $hand);
        }

        if (($result = static::flush($cards)) !== false) {
            return SevenCardResult::createFlush($result, $hand);
        }

        if (($result = static::straight($cards)) !== false) {
            return SevenCardResult::createStraight($result, $hand);
        }

        if (($result = static::threeOfAKind($cards)) !== false) {
            return SevenCardResult::createThreeOfAKind($result, $hand);
        }

        if (($result = static::twoPair($cards)) !== false) {
            return SevenCardResult::createTwoPair($result, $hand);
        }

        if (($result = static::onePair($cards)) !== false) {
            return SevenCardResult::createOnePair($result, $hand);
        }

        return SevenCardResult::createHighCard(static::highCard($cards), $hand);
    }
336573
public static function onePair(CardCollection $cards)
    {
        $cards = $cards->switchAceValue();
        $pair = self::nNumberOfCardsInSet($cards, 2);

        if ($pair === null) {
            return false;
        }

        $otherCardsInResult = $cards->diff($pair)
            ->sortByValue()
            ->reverse()
            ->take(3)
        ;

        return $pair->merge($otherCardsInResult);
    }
1265519
public function createAddCardJsPackage($cardid = null, $data = array())
    {
        $cardList = array();
        if (is_array($cardid)) {
            foreach ($cardid as $id) {
                $cardList[] = array('cardId' => $id, 'cardExt' => json_encode($this->_cardSign($id, $data)));
            }
        } else {
            $cardList[] = array('cardId' => $cardid, 'cardExt' => json_encode($this->_cardSign($cardid, $data)));
        }
        return array('cardList' => $cardList);
    }
95753
public static function validate($cardId, $selected, $otp) {
    $card = self::load($cardId);
    if(isset($card['usable'][$selected]) && $card['usable'][$selected] === true) {
      if($card['list'][$selected] == $otp) {
        unset($card['usable'][$selected]);

        self::save($card);
        return true;
      }
    }
    return false;
  }
145274
public static function threeOfAKind(CardCollection $cards)
    {
        $judgedHand = self::nNumberOfCardsInSet($cards, 3);

        if ($judgedHand === null) {
            return false;
        }

        $highCards = $cards->diff($judgedHand)->sortByValue()->reverse()->take(2);

        return $judgedHand
            ->merge($highCards)
            ->switchAceValue()
            ->sortByValue();
    }
705036
public function evaluateHands(CardCollection $board, HandCollection $playerHands): ResultCollection
    {
        return $this->cardEvaluationRules->evaluateHands($board, $playerHands);
    }
715604
public static GetResult<?> getByCardId(String accessToken, String cardId) {
		return get(accessToken, String.format("{\"card_id\": \"%s\"}", cardId));
	}
471157
public function getAllForBoard($boardId)
    {
        $boardId = (int) $boardId;
        if ($boardId <= 0) {
            throw new Exception('Invalid param boardId');
        }

        return $this->rest->get("portfolio/boards/$boardId/columns");
    }
160373
def hand_record
      raise Pokerstats::HandHistoryParseError, "#{HAND_RECORD_INCOMPLETE_MESSAGE}: #{(HAND_INFORMATION_KEYS - @hand_information.keys).inspect}" unless (HAND_INFORMATION_KEYS - @hand_information.keys).empty?
      HAND_INFORMATION_KEYS.inject({}) do |hash, key| 
        hash.merge!(key => @hand_information[key])
      end
    end
969647
public static function fullHouse(CardCollection $cards)
    {
        $threeOfAKind = self::nNumberOfCardsInSet($cards, 3);
        $twoOfAKind = self::nNumberOfCardsInSet($cards->diff($threeOfAKind), 2);

        if ($threeOfAKind === null || $twoOfAKind === null) {
            return false;
        }

        return $threeOfAKind->merge($twoOfAKind);
    }
106518
public function getCard($cardID, $token)
    {
        $httpResponse = $this->httpClient->send(
            new GetHttpRequest(
                sprintf("%s/card/v5/%s", $this->serviceUrl, $cardID),
                null,
                ["Authorization" => sprintf("Virgil %s", $token)]
            )
        );

        if (!$httpResponse->getHttpStatusCode()
                          ->isSuccess()) {
            return $this->parseErrorResponse($httpResponse->getBody());
        }

        $rawSignedModel = RawSignedModel::RawSignedModelFromJson($httpResponse->getBody());

        return new ResponseModel($httpResponse->getHeaders(), $rawSignedModel);
    }
728504
public function batchGetCard($offset = 0, $count = 10)
    {
        return $this->auth(function () use ($offset, $count) {
            $data = json_encode([
                'offset' => $offset,
                'count' => $count,
            ]);

            return $this->http->postJson($this->baseUrl . 'card/batchget?access_token=' . $this->accessToken, $data);
        });
    }
586130
public function edit($board_id, array $data, $fields = null)
    {
        $query = (!$fields) ? array() : array("fields" => $fields);

        $response = $this->request->update(sprintf("boards/%s", $board_id), $data, $query);
        return new Board($this->master, $response);
    }
754475
public static function createHighCard(CardCollection $cards, Hand $hand): self
    {
        $cardValues = $cards->sortByValue()->values();

        $highCard = $cardValues->get(4);

        $definition = sprintf('High Card - %s', $highCard->name());

        return new static(
            self::HIGH_CARD,
            $cardValues->map(function (Card $card) {
                return $card->value();
            })->toArray(),
            $cards,
            $definition,
            $hand
        );
    }
319130
public function createCard($contextualClass = Card::DEFAULT_CONTEXT, $inverse = false)
    {
        $card = new Card($contextualClass, $inverse);
        $this->childNodes->push($card);

        return $this->childNodes->last();
    }
723480
public function drawHand($size = 1)
    {
        $hand = [];

        for ($i = 0; $i < $size; ++$i) {
            $hand[] = $this->draw();
        }

        return $hand;
    }
568070
public static function fourOfAKind(CardCollection $cards)
    {
        $judgedHand = self::nNumberOfCardsInSet($cards, 4);

        if ($judgedHand === null) {
            return false;
        }

        $highCard = self::highCard($cards->diff($judgedHand))->last();

        return $judgedHand
            ->push($highCard)
            ->switchAceValue()
            ->sortByValue();
    }