Kind of working booster packs
This commit is contained in:
@@ -273,5 +273,79 @@ namespace Data.CardSystem
|
||||
|
||||
return (float)collectedInZone / totalInZone * 100f;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all available card definitions in the system
|
||||
/// </summary>
|
||||
public List<CardDefinition> GetAllCardDefinitions()
|
||||
{
|
||||
return new List<CardDefinition>(availableCards);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns direct access to the player's card inventory
|
||||
/// For advanced operations and testing
|
||||
/// </summary>
|
||||
public CardInventory GetCardInventory()
|
||||
{
|
||||
return playerInventory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns cards filtered by both zone and rarity
|
||||
/// </summary>
|
||||
public List<CardData> GetCardsByZoneAndRarity(CardZone zone, CardRarity rarity)
|
||||
{
|
||||
List<CardData> zoneCards = GetCardsByZone(zone);
|
||||
return zoneCards.FindAll(c => c.Rarity == rarity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the count of cards by rarity
|
||||
/// </summary>
|
||||
public int GetCardCountByRarity(CardRarity rarity)
|
||||
{
|
||||
return playerInventory.GetCardsByRarity(rarity).Count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the count of cards by zone
|
||||
/// </summary>
|
||||
public int GetCardCountByZone(CardZone zone)
|
||||
{
|
||||
return playerInventory.GetCardsByZone(zone).Count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the total number of card definitions available in the system
|
||||
/// </summary>
|
||||
public int GetTotalCardDefinitionsCount()
|
||||
{
|
||||
return availableCards.Count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the total collection completion percentage (0-100)
|
||||
/// </summary>
|
||||
public float GetTotalCompletionPercentage()
|
||||
{
|
||||
if (availableCards.Count == 0) return 0;
|
||||
return (float)GetUniqueCardCount() / availableCards.Count * 100f;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets total completion percentage for a specific rarity (0-100)
|
||||
/// </summary>
|
||||
public float GetRarityCompletionPercentage(CardRarity rarity)
|
||||
{
|
||||
// Count available cards of this rarity
|
||||
int totalOfRarity = availableCards.FindAll(c => c.Rarity == rarity).Count;
|
||||
if (totalOfRarity == 0) return 0;
|
||||
|
||||
// Count collected cards of this rarity
|
||||
int collectedOfRarity = playerInventory.GetCardsByRarity(rarity).Count;
|
||||
|
||||
return (float)collectedOfRarity / totalOfRarity * 100f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user