public AnimatedHandGameComponent(int place, Hand hand, Cards_FrameWork.Game.CardsGame cardGame) : base(cardGame, null) { Place = place; hand.ReceivedCard += Hand_ReceiveCard; hand.LostCard += Hand_LostCard; if (place == -1) { CurrentPosition = CardGame.GameTable.DealerPosition; } else { CurrentPosition = CardGame.GameTable[place]; } for (int cardIndex = 0; cardIndex < hand.Count; cardIndex++) { AnimatedCardsGameComponent animatedCardGameComponent = new AnimatedCardsGameComponent(hand[cardIndex], CardGame) { CurrentPosition = CurrentPosition + new Vector2(30 * cardIndex, 0) }; heldAnimationCards.Add(animatedCardGameComponent); Game.Components.Add(animatedCardGameComponent); } Game.Components.ComponentRemoved += Components_ComponentRemoved; }
void Hand_ReceiveCard(object sender, CardEvents e) { AnimatedCardsGameComponent animatedCardGameComponent = new AnimatedCardsGameComponent(e.Card, CardGame) { Visible = false }; heldAnimationCards.Add(animatedCardGameComponent); Game.Components.Add(animatedCardGameComponent); }