コード例 #1
0
ファイル: R4UDeck.cs プロジェクト: unsiga25/r4utools
 /// <summary>
 /// Replaces a card with a new card, using the same ratio as the old card.
 /// Returns false if the old card cannot be found on the deck.
 /// </summary>
 /// <param name="oldCard"></param>
 /// <param name="newCard"></param>
 public bool ReplaceCard(R4UCard oldCard, R4UCard newCard)
 {
     if (newCard == null)
     {
         return(false);
     }
     else if (Ratios.TryGetValue(oldCard, out int oldRatio))
     {
         Ratios[newCard] = oldRatio;
         Ratios.Remove(oldCard);
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #2
0
 internal Task <R4UCard> FindNonFoil(R4UCard card)
 {
     return(Task.FromResult(((card.IsFoil) ? card.Alternates.FirstOrDefault() : card) ?? card));
 }