public void AddBuff(IBuff buff) { IBuff repeatBuff = null; for (int i = 0; i < Buffs.Count; i++) { if (Buffs[i].GetType() == buff.GetType()) { repeatBuff = Buffs[i]; break; } } if (repeatBuff != null) { Buffs.Remove(repeatBuff); } IBuff newBuff = buff.Copy(this, _battle); Buffs.Add(newBuff); newBuff.StartBuff(); }
protected IBuff(IBuff buff, IUnit unit, ICore core) { NumberOfLifeTick = buff.NumberOfLifeTick; Unit = unit; Core = core; }
public void RemoveBuff(IBuff buff) { buff.EndBuff(); Buffs.Remove(buff); }