Esempio n. 1
0
    private void PlayCards()
    {
        tokenStash = GenerateNewDeck();
        DeckActions.Shuffle(tokenStash);

        //foreach (var token in tokenStash)
        //{
        //    Debug.Log(token);
        //}
    }
Esempio n. 2
0
    void PlayCards()
    {
        itemDeck = GenerateNewDeck();
        DeckActions.Shuffle(itemDeck);

        //foreach (var card in itemDeck)
        //{
        //    Debug.Log(card);
        //}
    }
    void PlayCards()
    {
        exploringDeck = GenerateNewDeck();
        DeckActions.Shuffle(exploringDeck);

        //foreach (var card in exploringDeck)
        //{
        //    Debug.Log(card);
        //}
    }
Esempio n. 4
0
    private void PlayCards()
    {
        beastDeck = GenerateNewDeck();
        DeckActions.Shuffle(beastDeck);

        //foreach (var card in beastDeck)
        //{
        //    Debug.Log(card);
        //}
    }
Esempio n. 5
0
        public void AddCards_insertTwoCards_deckHasTwoCards()
        {
            GameObject test = new GameObject();

            test.name = "AddCards_insertTwoCards_deckHasTwoCards";
            GameObject  obj  = Helpers.MakeDeckObject(test.transform);
            DeckActions deck = obj.GetComponent <DeckActions> ();

            GameObject[] cardsToAdd = Helpers.MakeCards(2, test.transform);

            deck.AddCards(cardsToAdd);

            bool deckHasTwoCards = (deck.DeckCount() == 2);

            Assert.That(deckHasTwoCards);
            GameObject.DestroyImmediate(test);
        }
Esempio n. 6
0
        public void DrawCards_drawTwoCards_deckHasTwoLessCards()
        {
            GameObject test = new GameObject();

            test.name = "DrawCards_drawTwoCards_deckHasTwoLessCards";
            GameObject  obj  = Helpers.MakeDeckObject(test.transform);
            DeckActions deck = obj.GetComponent <DeckActions> ();

            GameObject[] cardsToAdd = Helpers.MakeCards(4, test.transform);
            deck.AddCards(cardsToAdd);
            int deckCountBeforeDraw = deck.DeckCount();

            deck.DrawCards(2);

            int  deckCountAfterDraw = deck.DeckCount();
            bool deckIsTwoLess      = ((deckCountBeforeDraw - deckCountAfterDraw) == 2);

            Assert.That(deckIsTwoLess);
            GameObject.DestroyImmediate(test);
        }
Esempio n. 7
0
        public void AddCards_insertOneCard_deckHasOneCard()
        {
            GameObject test = new GameObject();

            test.name = "AddCards_insertOneCard_deckHasOneCard";
            //arrange
            GameObject obj = Helpers.MakeDeckObject(test.transform);

            obj.transform.parent = test.transform;
            DeckActions deck = obj.GetComponent <DeckActions> ();

            GameObject[] cardToAdd = Helpers.MakeCards(1, test.transform);
            //act
            deck.AddCards(cardToAdd);
            //assert
            bool deckHasOneCard = (deck.DeckCount() == 1);

            Assert.That(deckHasOneCard);
            //cleanup
            GameObject.DestroyImmediate(test);
        }
Esempio n. 8
0
        public void DrawCards_draw4CardsOutOfDeckOf2With2Discards_deckAndDiscardsEmpty()
        {
            GameObject test = new GameObject();

            test.name = "DrawCards_draw4CardsOutOfDeckOf2With2Discards_deckAndDiscardsEmpty";
            GameObject  obj  = Helpers.MakeDeckObject(test.transform);
            DeckActions deck = obj.GetComponent <DeckActions> ();

            GameObject[] cardsToAdd = Helpers.MakeCards(2, test.transform);
            deck.AddCards(cardsToAdd);
            GameObject[] cardsToDiscard = Helpers.MakeCards(2, test.transform);
            deck.DiscardCards(cardsToDiscard);

            deck.DrawCards(4);

            int deckCount    = deck.DeckCount();
            int discardCount = deck.DiscardCount();
            //Debug.Log (deckCount);
            //Debug.Log (discardCount);
            bool decksAreEmpty = (0 == (deckCount + discardCount));

            Assert.That(decksAreEmpty);
            GameObject.DestroyImmediate(test);
        }
Esempio n. 9
0
 public void PushAndShuffel(ICard card)
 {
     EventDeck.Add(card);
     DeckActions.Shuffle(EventDeck);
 }
Esempio n. 10
0
 void Awake()
 {
     deck     = GetComponent <DeckActions> ();
     mainMesh = GetComponent <MeshRenderer> ();
     UpdateDeckDisplay();
 }