Пример #1
0
    public void AddBuff(PlayerBuff buff)
    {
        PlayerBuff oldBuff = playerBuffs.FirstOrDefault(o => o.BuffName == buff.BuffName);
        PlayerBuff newBuff = null;

        if (oldBuff == null)
        {
            newBuff = buff.Clone();
            playerBuffs.Add(newBuff);
        }
        else
        {
            newBuff = oldBuff;
        }

        if (newBuff != null)
        {
            newBuff.StartBuff(this);
        }
    }