Exemplo n.º 1
0
 public static void LockBid(TwentyNineLobby lobby, ConstantLibrary.DuoTeams teamSelection, int biddingScore)
 {
     lobby.BidWinner    = teamSelection.SelectedTeam ? lobby.TeamA : lobby.TeamB;
     lobby.BiddingScore = biddingScore;
 }
Exemplo n.º 2
0
        public static bool RegisterPlayerToTeam(TwentyNineLobby lobby, Player player, ConstantLibrary.DuoTeams teamSelection)
        {
            /* In ConstantLibrary.DuoTeams TeamA is const true & TeamB is const false. SelectedTeam value will be placed by service user which will
             * determine wherather the player goes to team A or B */
            List <Player> team = teamSelection.SelectedTeam ? lobby.TeamA : lobby.TeamB;

            /* In case of an existing player switching teams, the player needs to be removed from previous team before registering
             * the player to desired team */
            if (lobby.TeamA.Contains(player))
            {
                lobby.TeamA.Remove(player);
            }
            if (lobby.TeamB.Contains(player))
            {
                lobby.TeamB.Remove(player);
            }

            // A most card games have 2 teams with only 2 player max in each
            if (team.Count < 2)
            {
                team.Add(player);
                return(true);
            }
            else
            {
                return(false);
            }
        }