ctac.ActionSpawnDeckCommand.Execute C# (CSharp) Method

Execute() public method

public Execute ( ) : void
return void
        public override void Execute()
        {
            if (!processedActions.Verify(spawnDeck.id)) return;

            //holding area that all cards go into to start with until the deck mediator sorts them out
            var DeckGO = GameObject.Find("Deck");

            for (var c = 0; c < spawnDeck.cards; c++)
            {
                var cardModel = new CardModel()
                {
                    playerId = spawnDeck.playerId,
                };

                cardService.CreateCard(cardModel, DeckGO.transform);

                decks.Cards.Add(cardModel);
            }

            deckSpawned.Dispatch(spawnDeck);
            debug.Log(string.Format("Spawned deck for player {0}", spawnDeck.playerId), socketKey);
        }
ActionSpawnDeckCommand