Package net.sf.nebulacards.main

Examples of net.sf.nebulacards.main.PileOfCards


    m_game = r;
    cm = _cm;
    for (int i = 0; i < 4; i++) {
      m_game.getPlayers()[i] = new Player("");
      m_game.getPlayers()[i].setScoreAndBags(0, 0);
      m_game.getHands()[i] = new PileOfCards();
      cardsWon[i] = new PileOfCards();
      incomingBids[i] = null;
      incomingPasses[i] = null;
      incomingPlays[i] = null;
      incomingResponses[i] = null;
      coms[i] = cm.getCommunicator(i);
View Full Code Here


    }
    // distribute the new hands
    for (int i = 0; i < 4; i++) {
      m_game.getHands()[i].sort(m_game);
      synchronized (coms[i]) {
        coms[i].dealHand(new PileOfCards(m_game.getHands()[i]));
      }
    }
  }
View Full Code Here

  private void conductGame() throws IOException, InterruptedException {
    for (int handCount = 0;; handCount++) {
      // start a new hand
      // clear old piles
      for (int i = 0; i < 4; i++) {
        cardsWon[i] = new PileOfCards();
        m_game.getHands()[i] = new PileOfCards();
      }
      beenPlayed = new PileOfCards();
      tableau = new Tableau();
      GameProcedure[] order = m_game.getProcedureOrdering();
      for (int i = 0; order != null && i < order.length; i++) {
        switch (order[i].getProcedure()) {
        case GameProcedure.DEALCARDS:
View Full Code Here

   *            The position where the new player is sitting.
   */
  public void reconnect(int where) {
    synchronized (coms[where]) {
      if (!m_game.getHands()[where].isEmpty())
        coms[where].dealHand(new PileOfCards(m_game.getHands()[where]));
      coms[where].setTrump(m_game.getTrump(), m_game.getTrumpName());
      PileOfCards tmp = new PileOfCards(beenPlayed);
      tmp.removeAll(tableau);
      coms[where].playedSoFar(tmp);
      // resend tableau
      for (int i = 0; i < 4; i++) {
        PlayingCard c = tableau.get(i);
        if (!c.isNull())
View Full Code Here

  public static PileOfCards[] deal(PileOfCards deck)
  {
    deck.shuffle();
    PileOfCards[] hands = new PileOfCards[4];
    for (int i = 0; i < 4; i++)
      hands[i] = new PileOfCards( 13 );
    java.util.Enumeration cards = deck.elements();
    int who = 0;
    while (cards.hasMoreElements())
    {
      hands[who].add( (PlayingCard)(cards.nextElement()) );
View Full Code Here

TOP

Related Classes of net.sf.nebulacards.main.PileOfCards

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.