internal void CreateCardToBattleDeckDiscardPile(AbstractCard abstractCard, AbstractBattleUnit owner = null, CardCreationLocation location = CardCreationLocation.SHUFFLE, QueueingType queueingType = QueueingType.TO_BACK) { Require.NotNull(abstractCard); abstractCard.Owner = owner; QueuedActions.ImmediateAction("CreateCardToBattleDeckDiscardPile", () => { BattleRules.MarkCreatedCard(abstractCard, owner); if (location == CardCreationLocation.BOTTOM) { ServiceLocator.GameState().Deck.DiscardPile.Add(abstractCard); } else if (location == CardCreationLocation.TOP) { ServiceLocator.GameState().Deck.DiscardPile.AddToFront(abstractCard); } else if (location == CardCreationLocation.SHUFFLE) { ServiceLocator.GameState().Deck.DiscardPile.InsertIntoRandomLocation(abstractCard); } else { throw new Exception("gotta select a location"); } }, queueingType); }
internal void CreateCardToHand(AbstractCard abstractCard, AbstractBattleUnit owner = null, QueueingType queueingType = QueueingType.TO_BACK) { Require.NotNull(abstractCard); abstractCard.Owner = owner; QueuedActions.ImmediateAction("CreateCardToHand", () => { BattleRules.MarkCreatedCard(abstractCard, owner); ServiceLocator.GameState().Deck.Hand.Add(abstractCard); ServiceLocator.GetCardAnimationManager().AddHypercardsToHand(new List <Card> { abstractCard.CreateHyperCard() }); }, queueingType); }