private void AddCard(CardZone cardZone, ICard card) { var overlayCardType = (cardZone.Location == CardZoneLocation.Top) ? OverlayCardType.TopCardZone : OverlayCardType.BottomCardZone; var newOverlayCard = new OverlayCardViewModel(_configuration, overlayCardType) { Card = card }; _overlayCards.AddOverlayCard(newOverlayCard); }
public static void AddOverlayCard(this IList <OverlayCardViewModel> cards, OverlayCardViewModel cardViewModel) { var insertIndex = cards.Count; if (cardViewModel.CardInfo.Type == CardType.Agenda) { //add this directly to the left of the first act var firstAct = cards.FirstOrDefault(x => x.CardInfo.Type == CardType.Act); if (firstAct != null) { insertIndex = cards.IndexOf(firstAct); } } cards.Insert(insertIndex, cardViewModel); }