First MVP of sorting minigame (#60)
Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com> Co-authored-by: Michal Pikulski <michal@foolhardyhorizons.com> Reviewed-on: #60
This commit is contained in:
@@ -631,6 +631,25 @@ namespace Data.CardSystem
|
||||
return _pendingRevealCards.Count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a random card definition of the specified rarity.
|
||||
/// Used by minigames to spawn cards without affecting player's collection.
|
||||
/// </summary>
|
||||
public CardDefinition GetRandomCardDefinitionByRarity(CardRarity targetRarity)
|
||||
{
|
||||
// Filter available cards by rarity
|
||||
var matchingCards = availableCards.Where(c => c.Rarity == targetRarity).ToList();
|
||||
|
||||
if (matchingCards.Count == 0)
|
||||
{
|
||||
Debug.LogWarning($"[CardSystemManager] No card definitions found for rarity {targetRarity}");
|
||||
return null;
|
||||
}
|
||||
|
||||
// Return random card from matching rarity
|
||||
return matchingCards[UnityEngine.Random.Range(0, matchingCards.Count)];
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user