public void InitConsumable() { if (!RequiresInitialisation) { return; } string selectedItemId = ""; List <AConsumableBase> consumables = new List <AConsumableBase> (); switch (AffectsDemand) { case AConsumableBase.EDemand.Hunger: { selectedItemId = ItemIDStorage.GetHungerDecreaserID(HungerDecreaserType); consumables = ItemsData.GetConsumablesOfType <HungerDecreaser> (); break; } case AConsumableBase.EDemand.Stress: { selectedItemId = ItemIDStorage.GetStressDecreaserID(StressDecreaserType); consumables = ItemsData.GetConsumablesOfType <StressDecreaser> (); break; } } if (consumables.Count > 0) { _selectedConsumable = consumables.First(c => c.ItemID == selectedItemId); ApplyImage(); } }
public void SetItem(AConsumableBase item) { _selectedConsumable = item; ApplyImage(); }