Exemplo n.º 1
0
        public void PlayRound()
        {
            DealInitialHand();
            int      highestBidderIndex = PlaceBids();
            CardSuit roundSuit          = ChooseSuit(highestBidderIndex);//temperary until ui

            DiscardAllOffSuits(roundSuit);
            RefillHands();
            PlayHand(highestBidderIndex);
            team1.AddPoints();
            team2.AddPoints();
            PedroTeam winningTeam = new PedroTeam();

            if (Win())
            {
                winningTeam = GetWinningTeam();
            }
            string teamMembers = "";

            foreach (PointPlayer player in _players)
            {
                if (player.Team == winningTeam)
                {
                    teamMembers = player.Username + " ";
                }
            }
            Console.WriteLine(teamMembers + "has won the game");//teporary until ui is done
        }
Exemplo n.º 2
0
        public PedroTable(List <Player> players) : base(players)
        {
            _cardsOnTable = new List <Card>();
            PointsOnTable = 0;
            team1         = new PedroTeam();
            team2         = new PedroTeam();
            _players      = new List <PointPlayer>();
            for (int i = 0; i < 4; i++)
            {
                switch (i % 2)
                {
                case 0:
                    _players.Add(new PointPlayer(players[i], 0, team1));
                    break;

                case 1:
                    _players.Add(new PointPlayer(players[i], 0, team2));
                    break;
                }
            }
        }
Exemplo n.º 3
0
 // Constructor: PointPlayer - username, wins, losses, points
 public PointPlayer(string username, int points, PedroTeam team)
     : base(username)
 {
     Points = points;
     Team   = team;
 }
Exemplo n.º 4
0
 public PointPlayer(Player player, int points, PedroTeam team) : base(player.Username)
 {
     Points = points;
     Team   = team;
 }