Ejemplo n.º 1
0
 public static void InvokeOnConsume(OnConsumeEventArgs e)
 {
     if (OnConsume != null)
     {
         OnConsume(e);
     }
 }
Ejemplo n.º 2
0
		public static void InvokeOnConsume(OnConsumeEventArgs e)
		{
			if (OnConsume != null)
			{
				OnConsume(e);
			}
		}
Ejemplo n.º 3
0
        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()]);
            }
        }
Ejemplo n.º 4
0
 public static void InvokeOnConsume(OnConsumeEventArgs e)
 {
     OnConsume?.Invoke(e);
 }