Esempio n. 1
0
    public void TriggerEvent(ModifierEventType eType)
    {
        List <BaseAction> actions;

        if (isOrb)
        {
            switch (eType)
            {
            case ModifierEventType.OnAttack:
                eType = ModifierEventType.Orb;
                break;

            case ModifierEventType.OnAttackStart:
                eType = ModifierEventType.OnOrbFire;
                break;

            case ModifierEventType.OnAttackLanded:
                eType = ModifierEventType.OnOrbImpact;
                break;
            }
        }
        if (eventActions.TryGetValue(eType, out actions))
        {
            int count = actions.Count;
            for (int i = 0; i < count; i++)
            {
                actions[i].Execute();
            }
        }
    }
Esempio n. 2
0
    public void TriggerModifierEvent(ModifierEventType eType)
    {
        int count = modifiers.Count;

        for (int i = 0; i < count; i++)
        {
            modifiers[i].TriggerEvent(eType);
        }
    }
Esempio n. 3
0
 public void RegisterEvent(ModifierEventType eType, BaseAction action)
 {
     if (!eventActions.ContainsKey(eType))
     {
         eventActions.Add(eType, new List <BaseAction>());
     }
     if (!eventActions[eType].Contains(action))
     {
         eventActions[eType].Add(action);
     }
     else
     {
         CLog.Info("There is same action with the event type: %s", action.ToString());
     }
 }
Esempio n. 4
0
    public void RegisterEvent(ModifierEventType eType, List <BaseAction> actions)
    {
        if (!eventActions.ContainsKey(eType))
        {
            eventActions.Add(eType, new List <BaseAction>());
        }
        int count = actions.Count;

        for (int i = 0; i < count; i++)
        {
            if (!eventActions[eType].Contains(actions[i]))
            {
                eventActions[eType].Add(actions[i]);
            }
            else
            {
                CLog.Info("There is same action with the event type: %s", actions[i].ToString());
            }
        }
    }