Пример #1
0
        public void LoadDeckFromConfigurationData(Player player, ConfigurationData cnfDat)
        {
            // TENEMOS QUE CARGAR AL CARD COLLECTION MANAGER DESDE ALGUN LUGAR
            Deck userDeck = cnfDat.selectedDeck;
            List <DefaultCollectionDataDB> dfColl = userDeck.userDeckJson;
            List <Card> cardsOnDeck = new List <Card>();

            for (int i = 0; i < dfColl.Count; i++)
            {
                for (int x = 0; x < dfColl[i].Amount; x++)
                {
                    CardData cardData = inGameCardCollectionManager.GetCardDataByCardID(dfColl[i].ID);
                    Card     card     = CardPropertiesDatabase.GetCardFromID(cardData.ID);
                    if (card == null)
                    {
                        continue;
                    }
                    card.InitializeCard(cardIndex, player, cardData);
                    card.SetCardState(CARDSTATES.DECK);
                    //Card card = new Card(cardIndex, player, cardData);
                    cardIndex++;
                    cardsOnDeck.Add(card);
                }
            }
            // ACA DEBERIAMOS CHEQUEAR QUE NUESTRO MAZO SEA VALIDO
            Shuffle(cardsOnDeck);
            player.Deck = new Stack <Card>(cardsOnDeck);
        }
Пример #2
0
        public void LoadDeckTest(Player player)
        {
            List <Card> cardsOnDeck      = new List <Card>();
            CardData    buffUnitCardData = inGameCardCollectionManager.GetCardDataByCardID("CardID1");
            Card        buffUnitCard     = CardPropertiesDatabase.GetCardFromID(buffUnitCardData.ID);

            buffUnitCard.InitializeCard(cardIndex, player, buffUnitCardData);
            buffUnitCard.SetCardState(CARDSTATES.DECK);
            cardsOnDeck.Add(buffUnitCard);
            cardIndex++;

            CardData nerUnitCardData = inGameCardCollectionManager.GetCardDataByCardID("CardID8");
            Card     nerfUnitCard    = CardPropertiesDatabase.GetCardFromID(nerUnitCardData.ID);

            nerfUnitCard.InitializeCard(cardIndex, player, nerUnitCardData);
            nerfUnitCard.SetCardState(CARDSTATES.DECK);
            cardsOnDeck.Add(nerfUnitCard);
            cardIndex++;

            CardData healUnitCardData = inGameCardCollectionManager.GetCardDataByCardID("CardID4");
            Card     healUnitCard     = CardPropertiesDatabase.GetCardFromID(healUnitCardData.ID);

            healUnitCard.InitializeCard(cardIndex, player, healUnitCardData);
            healUnitCard.SetCardState(CARDSTATES.DECK);
            cardsOnDeck.Add(healUnitCard);
            cardIndex++;


            // ACA DEBERIAMOS CHEQUEAR QUE NUESTRO MAZO SEA VALIDO
            Shuffle(cardsOnDeck);
            player.Deck = new Stack <Card>(cardsOnDeck);
        }
Пример #3
0
 public CardController(InGameCardCollectionManager cardCollectionManager, CardManagerUI cardManagerUI, GameMachine game)
 {
     this.inGameCardCollectionManager = cardCollectionManager;
     this.cardManagerUI       = cardManagerUI;
     cardTargetFiltterManager = new CardTargetFiltterManager(game.turnController, game.board2DManager);
     cardEffectManager        = new CardEffectManager();
     this.game = game;
     CardPropertiesDatabase.GetCardSubClassByReflection();
 }