Exemple #1
0
 public Game(GameSetup gameSetup, string tournamentId = "")
 {
     Id                            = Guid.NewGuid().ToString();
     GameSetup                     = gameSetup;
     TournamentId                  = tournamentId;
     Players                       = new List <Player>();
     Spectators                    = new List <Spectator>();
     ChatMessages                  = new List <ChatMessage>();
     HandCuffedPlayers             = new List <Player>();
     GameLog                       = new List <string>();
     ReadyPlayersLeft              = new List <string>();
     ReadyPhaseExpireUtc           = DateTime.Now;
     BannedUsers                   = new List <User>();
     DiscardedPile                 = new List <ICard>();
     SilenceTurnsRemaining         = 0;
     CardValuesRemovedFromTheRound = new List <CardValue>();
     GreedAffectedPlayers          = new Dictionary <Player, int>();
     DrawAutoPlayPlayer            = null;
     DrawAutoPlayCard              = null;
 }
Exemple #2
0
        private void InitializeCards(GameSetup gameSetup)
        {
            Cards = new List <ICard>();

            AddNormalGameNormalCards();
            AddNormalGameWildCards();

            if (gameSetup.GameType == GameType.SpecialWildCards)
            {
                AddNormalGameNormalCards();
                AddNormalGameNormalCards();

                AddStealTurnCards();
                AddStealTurnCards();
                AddStealTurnCards();

                AddSpecialWildCards();
            }


            FilterBannedCards(gameSetup.BannedCards);
        }
Exemple #3
0
        private void InitializeCards(GameSetup gameSetup)
        {
            AddNormalGameNormalCards();
            AddNormalGameWildCards(gameSetup.LimitColorChangingCards);

            if (gameSetup.GameType == GameType.SpecialWildCards)
            {
                for (int i = 0; i < gameSetup.NumberOfStandardDecks; i++)
                {
                    AddStealTurnCards();
                    if (i != gameSetup.NumberOfStandardDecks - 1)
                    {
                        AddNormalGameNormalCards();
                    }
                }
                AddSpecialWildCards(gameSetup.LimitColorChangingCards);
            }

            FilterBannedCards(gameSetup.BannedCards);

            var totalCards = Cards.Count;

            if (totalCards == 0)
            {
                AddNormalGameNormalCards();
                AddNormalGameWildCards(gameSetup.LimitColorChangingCards);
            }
            else
            {
                var minimumCardsRequired = gameSetup.MaxNumberOfPlayers * 7;
                if (totalCards < minimumCardsRequired)
                {
                    InitializeCards(gameSetup);
                }
            }
        }
Exemple #4
0
 public Deck(GameSetup gameSetup)
 {
     Cards = new List <ICard>();
     InitializeCards(gameSetup);
 }
Exemple #5
0
 public Deck(GameSetup gameSetup)
 {
     InitializeCards(gameSetup);
     Shuffle();
 }