/// <summary> /// Gets a list of all cards added to the given card pool by mods. /// Cards which naturally appear in the pool will not be returned. /// </summary> /// <param name="cardPoolID">ID of the card pool to get cards for</param> /// <returns>A list of cards added to the card pool with given ID by mods</returns> public static List <CardData> GetCardsForPool(string cardPoolID) { if (CustomCardPoolData.ContainsKey(cardPoolID)) { return(CustomCardPoolData[cardPoolID]); } return(new List <CardData>()); }
/// <summary> /// Add the card to the card pools with given IDs. /// </summary> /// <param name="cardData">CardData to be added to the pools</param> /// <param name="cardPoolIDs">List of card pool IDs to add the card to</param> public static void AddCardToPools(CardData cardData, List <string> cardPoolIDs) { foreach (string cardPoolID in cardPoolIDs) { if (CustomCardPools.ContainsKey(cardPoolID)) { var pool = CustomCardPools[cardPoolID]; var cardDataList = (Malee.ReorderableArray <CardData>)AccessTools.Field(typeof(CardPool), "cardDataList").GetValue(pool); cardDataList.Add(cardData); } else { if (!CustomCardPoolData.ContainsKey(cardPoolID)) { CustomCardPoolData[cardPoolID] = new List <CardData>(); } CustomCardPoolData[cardPoolID].Add(cardData); } } }