public void AddTrinket(Trinket trinket) { if (TrinketAddAction != null) { TrinketAddAction(trinket); } else { Trinkets.Add(trinket); } }
public void RestockTrinkets() { Trinkets.Clear(); var trinketList = DarkestDungeonManager.Data.Items["trinket"].Values.Cast <Trinket>().ToList(); for (int i = 0; i < TrinketSlots; i++) { var rarity = RandomSolver.ChooseByRandom(RarityTable).RarityId; var rarityList = trinketList.FindAll(item => item.RarityId == rarity); Trinkets.Add(rarityList[UnityEngine.Random.Range(0, rarityList.Count)]); } Trinkets.Sort((x, y) => y.PurchasePrice.CompareTo(x.PurchasePrice)); }