Package net.socialgamer.cah.db

Examples of net.socialgamer.cah.db.BlackCard


  private void playingState() {
    state = GameState.PLAYING;

    playedCards.clear();

    BlackCard newBlackCard;

    synchronized (blackCardLock) {
      if (blackCard != null) {
        blackDeck.discard(blackCard);
      }
      newBlackCard = blackCard = getNextBlackCard();
    }
    if (newBlackCard.getDraw() > 0) {
      synchronized (players) {
        for (final Player player : players) {
          if (getJudge() == player) {
            continue;
          }
          final List<WhiteCard> cards = new ArrayList<WhiteCard>(newBlackCard.getDraw());
          for (int i = 0; i < newBlackCard.getDraw(); i++) {
            cards.add(getNextWhiteCard());
          }
          player.getHand().addAll(cards);
          sendCardsToPlayer(player, cards);
        }
View Full Code Here


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

TOP

Related Classes of net.socialgamer.cah.db.BlackCard

Copyright © 2018 www.massapicom. 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.