Пример #1
0
        private void SelectedBenchedPokemonForEnergy(CardRenderer selectedCard)
        {
            if (!playerBench.GetComponentsInChildren <CardRenderer>().Any(controller => controller.card.Id.Equals(selectedCard.card.Id)))
            {
                return;
            }

            var energyCard = energyCardsToAttach.Dequeue();

            energyPokemonMap.Add(energyCard.Id, selectedCard.card.Id);

            if (energyCardsToAttach.Count == 0)
            {
                var response = new AttachedEnergyDoneMessage(energyPokemonMap);
                NetworkManager.Instance.SendToServer(response, true);
                energyPokemonMap.Clear();
            }
        }
Пример #2
0
        private void SelectedOpponentBenchedPokemon(CardRenderer cardController)
        {
            if (!opponentBench.GetComponentsInChildren <CardRenderer>().Any(controller => controller.card.Id.Equals(cardController.card.Id)) ||
                !(cardController.card is PokemonCard) ||
                !currentDeckFilters.All(f => f.IsCardValid(cardController.card)))
            {
                return;
            }

            ToggleCardSelected(cardController);
        }