예제 #1
0
        public void calculateAndStoreTeamResult(Team team, int numTricks1, int numTricks2)
        {
            int teamScore = 0;

            teamScore += getNilScore(team.getPlayer1(), numTricks1);
            teamScore += getNilScore(team.getPlayer2(), numTricks2);
            Tuple <int, int> scoreAndBags = getTeamNonNilScoreAndBags(team.getPlayer1(), team.getPlayer2(), numTricks1, numTricks2);

            teamScore = handleBags(team, teamScore, scoreAndBags);
            team.addScore(teamScore);
            team.addBid();
        }
예제 #2
0
        public Spades()
        {
            team1        = new Team(new Player(), new Player());
            team2        = new Team(new Player(), new Player());
            scoreHandler = new ScoreHandler();
            players      = new Player[4];
            players[0]   = team1.getPlayer1();
            players[1]   = team2.getPlayer1();
            players[2]   = team1.getPlayer2();
            players[3]   = team2.getPlayer2();

            startingPlayer = Utils.Instance.rnd.Next(4);
            bidding        = new Bidding(startingPlayer, players);
            deal           = new Deal(startingPlayer, players);
        }