public void Kill(IBonusEffect bEffect) { //if (BonusEffects.Count != 0) return; var finded = BonusEffects.FindAll((b) => { var bb = b.BonusType == bEffect.BonusType; return(bb); }); if (finded.Count == 0) { BonusEffects.Add(bEffect); if (bEffect.BonusType == BonusEffect.LINE_H || bEffect.BonusType == BonusEffect.LINE_V) { ((LineBonusEffect)bEffect).BeforeLastStep += (effect) => { switch (effect.Direction) { case LineBonusEffectDirection.LR: KillRightLine(); break; case LineBonusEffectDirection.RL: KillLeftLine(); break; case LineBonusEffectDirection.TB: KillBottomLine(); break; case LineBonusEffectDirection.BT: KillTopLine(); break; } }; } Kill(); } }
protected void SetBonusEffect(IBonusEffect effect) { BonusEffects.Add(effect); }