コード例 #1
0
 public void SetUp()
 {
     _john = new FiftyTwoCardGamePlayer()
     {
         Name = "John"
     };
     _jane = new FiftyTwoCardGamePlayer()
     {
         Name = "Jane"
     };
     _johnDuplicate = new FiftyTwoCardGamePlayer()
     {
         Name = "John",
     };
 }
コード例 #2
0
 public void SetUp()
 {
     _moveControllerMock = new Mock <IMoveController <FiftyTwoCardGamePlayer, FiftyTwoCardGameDeck, FiftyTwoCardGameCard> >();
     _cardTray           = new Mock <ICardTray <FiftyTwoCardGamePlayer, FiftyTwoCardGameDeck, FiftyTwoCardGameCard> >();
     _cards = new List <FiftyTwoCardGameCard>()
     {
         new FiftyTwoCardGameCard(Suite.Clubs, Face.Ace),
         new FiftyTwoCardGameCard(Suite.Hearts, Face.Ten),
         new FiftyTwoCardGameCard(Suite.Hearts, Face.Ace),
     };
     _sampleDeck = new FiftyTwoCardGameDeck();
     _sampleDeck.Put(_cards);
     _jane = new FiftyTwoCardGamePlayer()
     {
         Name   = "Jane",
         Status = PlayerStatus.Competing,
         Deck   = _sampleDeck
     };
 }
コード例 #3
0
        private static IEnumerable <FiftyTwoCardGamePlayer> CreatePlayersAndAssignDecks(
            IDictionary <string, IEnumerable <FiftyTwoCardGameCard> > playerCards)
        {
            foreach (var playerCard in playerCards)
            {
                var player = new FiftyTwoCardGamePlayer
                {
                    Name   = playerCard.Key,
                    Deck   = new FiftyTwoCardGameDeck(),
                    Status = PlayerStatus.Competing
                };
                foreach (var card in playerCard.Value)
                {
                    player.Deck.Put(card);
                }

                yield return(player);
            }
        }