public void ReturnToHand(CardViewModel target, string gameId) { using (var context = new MagicDbContext()) { var player = context.Players.Find(target.CasterId, gameId); //player.Deck. } }
public bool RestoreCardFromGraveyard(CardViewModel card, List<CardViewModel> targetCollection, bool copy = false) { if (Graveyard.Any(c => c.Id == card.Id)) { targetCollection.Add(card); if (!copy) { Graveyard.Remove(card); } return true; } return false; }
public bool PlayCard(CardViewModel card) { if (Hand.Any(c => c.Id == card.Id)) { Hand.Remove(card); card.Play(); return true; } return false; }
public bool PutCardToGraveyard(CardViewModel card, List<CardViewModel> targetCollection) { if (targetCollection.Exists(c => c.Id == card.Id)) { targetCollection.Remove(card); Graveyard.Add(card); return true; } return false; }
public bool ExileCard(CardViewModel card, List<CardViewModel> targetCollection) { if (targetCollection.Exists(c => c.Id == card.Id)) { Exiled.Add(card); targetCollection.Remove(card); return true; } return false; }