Examples of WhiteCard


Examples of net.socialgamer.cah.db.WhiteCard

    final Player[] playersCopy = players.toArray(new Player[players.size()]);
    for (final Player player : playersCopy) {
      final List<WhiteCard> hand = player.getHand();
      final List<WhiteCard> newCards = new LinkedList<WhiteCard>();
      while (hand.size() < 10) {
        final WhiteCard card = getNextWhiteCard();
        hand.add(card);
        newCards.add(card);
      }
      sendCardsToPlayer(player, newCards);
    }
View Full Code Here

Examples of net.socialgamer.cah.db.WhiteCard

      player.resetSkipCount();
      if (getJudge() == player || state != GameState.PLAYING) {
        return ErrorCode.NOT_YOUR_TURN;
      }
      final List<WhiteCard> hand = player.getHand();
      WhiteCard playCard = null;
      synchronized (hand) {
        final Iterator<WhiteCard> iter = hand.iterator();
        while (iter.hasNext()) {
          final WhiteCard card = iter.next();
          if (card.getId() == cardId) {
            playCard = card;
            if (WhiteDeck.isBlankCard(card)) {
              playCard.setText(cardText);
            }
            // remove the card from their hand. the client will also do so when we return
View Full Code Here

Examples of net.socialgamer.cah.db.WhiteCard

  public synchronized WhiteCard getNextCard() throws OutOfCardsException {
    if (deck.size() == 0) {
      throw new OutOfCardsException();
    }
    // we have an ArrayList here, so this is faster
    final WhiteCard card = deck.remove(deck.size() - 1);
    return card;
  }
View Full Code Here

Examples of net.socialgamer.cah.db.WhiteCard

   * Creates a new blank card.
   *
   * @return A newly created blank card.
   */
  private WhiteCard createBlankCard() {
    final WhiteCard blank = new WhiteCard();
    blank.setId(--lastBlankCardId);
    blank.setText("____");
    blank.setWatermark("____");
    return blank;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.