コード例 #1
0
ファイル: Game.cs プロジェクト: unidayo/Merchants
 public void Setup()
 {
     this._deck = new Deck();
     this._tokenPool = new TokenPool();
     this._specialCardPool = new SpecialCardPool();
     this._specialCardPool.Setup(_tokenPool);
     this._communityCards = new CommunityCard();
     _communityCards.AddFirst(_deck.Draw());
     _communityCards.AddSecond(_deck.Draw());
     _communityCards.AddThird(_deck.Draw());
     _communityCards.AddFourth(_deck.Draw());
     _communityCards.AddFifth(_deck.Draw());
     _communityCards.AddSixth(_deck.Draw());
 }
コード例 #2
0
ファイル: DeckTest.cs プロジェクト: unidayo/Merchants
        public void DeckCardTest()
        {
            var deck = new Deck();
            var cards = new List<ItemCard>();
            for (int i = 0; i < 60; i++)
            {
                cards.Add(deck.Draw());
            }

            int copperCount = 0;
            int hempCount = 0;
            int indigoCount = 0;
            int saltCount = 0;
            int pepperCount = 0;
            int cottonCount = 0;

            Assert.AreEqual(60, cards.Count, "カード枚数");

            foreach (var card in cards)
            {
                if (card == ItemCard.newCopper())
                    copperCount++;
                if (card == ItemCard.newHemp())
                    hempCount++;
                if (card == ItemCard.newIndigo())
                    indigoCount++;
                if (card == ItemCard.newSalt())
                    saltCount++;
                if (card == ItemCard.newPepper())
                    pepperCount++;
                if (card == ItemCard.newCotton())
                    cottonCount++;
            }

            Assert.AreEqual(10, copperCount, "銅");
            Assert.AreEqual(10, hempCount  , "麻");
            Assert.AreEqual(10, indigoCount, "藍");
            Assert.AreEqual(10, saltCount  , "塩");
            Assert.AreEqual(10, pepperCount, "胡椒");
            Assert.AreEqual(10, cottonCount, "綿");
        }
コード例 #3
0
ファイル: DeckTest.cs プロジェクト: unidayo/Merchants
 public void Draw()
 {
     var deck = new Deck();
     ItemCard card = deck.Draw();
     Assert.AreEqual(59, deck.Count);
 }