public static void InvokeOnConsume(OnConsumeEventArgs e) { if (OnConsume != null) { OnConsume(e); } }
private void EventSink_OnConsume(OnConsumeEventArgs e) { if (!this.Enabled || !Server.Core.AOS) return; FoodEffectModule module = e.Consumer.GetModule(typeof(FoodEffectModule)) as FoodEffectModule; if (module == null) module = new FoodEffectModule(e.Consumer); if (e.Consumed is Food) { Boolean effectAllowed = false; if (((Food)e.Consumed).PlayerConstructed) effectAllowed = true; if (m_ShouldFoodBeAllowed != null && m_ShouldFoodBeAllowed((Food)e.Consumed)) effectAllowed = true; if (!m_FoodEffects.ContainsKey(e.Consumed.GetType())) effectAllowed = false; if (effectAllowed) module.ApplyEffect(m_FoodEffects[e.Consumed.GetType()]); } }
public static void InvokeOnConsume(OnConsumeEventArgs e) { OnConsume?.Invoke(e); }