Package net.sf.nebulacards.main

Examples of net.sf.nebulacards.main.GameResult


    // furnish a result for this game, including whether the game is complete
    public GameResult done( Player[] p )
    {
    // this is called only once per hand, so we can increment handCount here
    handCount++;
        GameResult gr = new GameResult();
        if ( p[0].getScore() >= 500 || p[1].getScore() >= 500 ) gr.done = true;
        else gr.done = false;
        if ( p[0].getScore() == p[1].getScore() ) gr.done = false; // no ties
    gr.winners = new int[2];
        if ( p[0].getScore() > p[1].getScore() )
View Full Code Here


    }
  }

  // furnish a result for this game, including whether the game is complete
  public GameResult done(Player[] p) {
    GameResult gr = new GameResult();
    int highest = 0;
    boolean tied = false;

    // This method is called precisely once per hand, so we
    // increment the hand counter here.
View Full Code Here

        }
      } catch (NullPointerException e) { /* no summary */
      } catch (ClassCastException e) { /* m_game don't summarize */
      }

      GameResult gr = m_game.done(m_game.getPlayers());
      if (gr.done) {
        String res = "*** Game is complete. ***\nWinners are: ";
        if (gr.winners.length > 0)
          res += m_game.getPlayers()[gr.winners[0]].getName();
        for (int i = 1; i < gr.winners.length; i++)
          res += " & " + m_game.getPlayers()[gr.winners[i]].getName();
        res += "\n";
        broadcaster.chat(res);
        broadcaster.endGame(new GameResult(gr));
        break;
      }
      for (int i = 0; i < 4; i++) {
        m_game.getPlayers()[i].clearBid();
      }
View Full Code Here

TOP

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

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.