Esempio n. 1
0
 public void LoadEffector(Effector effector)
 {
     if (effectorDictionary.ContainsKey(effector.EffectorID))
     {
         effectorDictionary[effector.EffectorID] = effector;
         OnEffectorChanged?.Invoke(effector, DataChangeCode.Update);
     }
     else
     {
         effectorDictionary.Add(effector.EffectorID, effector);
         OnEffectorChanged?.Invoke(effector, DataChangeCode.Add);
     }
 }
Esempio n. 2
0
 public bool FindEffector(int effectorID, out Effector effector)
 {
     if (effectorDictionary.ContainsKey(effectorID))
     {
         effector = effectorDictionary[effectorID];
         return(true);
     }
     else
     {
         effector = null;
         return(false);
     }
 }
Esempio n. 3
0
        public Effector CreareEffector(Effect effect)
        {
            Effector effector = null;

            switch (effect.EffectType)
            {
            case EffectTypeCode.Taunt:
                effector = new TauntEffector(effectorID_Generator++, effect.EffectID);
                break;

            case EffectTypeCode.Charge:
                effector = new ChargeEffector(effectorID_Generator++, effect.EffectID);
                break;

            case EffectTypeCode.Windfury:
                effector = new WindfuryEffector(effectorID_Generator++, effect.EffectID);
                break;

            case EffectTypeCode.SilenceMinion:
                effector = new SilenceMinionEffector(effectorID_Generator++, effect.EffectID);
                break;

            case EffectTypeCode.SpellDamage:
                effector = new SpellDamageEffector(effectorID_Generator++, effect.EffectID);
                break;

            case EffectTypeCode.DealSpellDamageToAllEnemyMinions:
                effector = new DealSpellDamageToAllEnemyMinionsEffector(effectorID_Generator++, effect.EffectID);
                break;

            case EffectTypeCode.DrawCard:
                effector = new DrawCardEffector(effectorID_Generator++, effect.EffectID);
                break;

            case EffectTypeCode.DealSpellDamage:
                effector = new DealSpellDamageEffector(effectorID_Generator++, effect.EffectID);
                break;

            case EffectTypeCode.DestroyEnemyMinion:
                effector = new DestroyEnemyMinionEffector(effectorID_Generator++, effect.EffectID);
                break;

            case EffectTypeCode.DoubleMinionHealth:
                effector = new DoubleMinionHealthEffector(effectorID_Generator++, effect.EffectID);
                break;

            case EffectTypeCode.DoubleMinionAttack:
                effector = new DoubleMinionAttackEffector(effectorID_Generator++, effect.EffectID);
                break;

            case EffectTypeCode.GiveMinionAttackBuff:
                effector = new GiveMinionAttackBuffEffector(effectorID_Generator++, effect.EffectID);
                break;

            case EffectTypeCode.GiveMinionHealthBuff:
                effector = new GiveMinionHealthBuffEffector(effectorID_Generator++, effect.EffectID);
                break;

            case EffectTypeCode.RestoreHealth:
                effector = new RestoreHealthEffector(effectorID_Generator++, effect.EffectID);
                break;

            default:
                return(null);
            }
            LoadEffector(effector);
            return(effector);
        }