I'm following the tutorials of a Hack and Slash game on BurgZertgArcade.com I thinks i've done everything correctly, but when I want to lay, an error appears on the console that says: Assets/Scripts/Player/CharacterClasses/ModifiedStat.cs(25,33): error CS0019: Operator `+=' cannot be applied to operands of type`System.Collections.Generic.List' and `int'.
What can I do? What have I done wrong please help!
using System.Collections.Generic;
public class ModifiedStat : BaseStat
{
private List<ModifyingAttribute> _mods; //A list of attributes taht modify the stat
private int _modValue; //The amount added to the base value of the modifiers
public ModifiedStat()
{
_mods = new List<ModifyingAttribute>();
_modValue = 0;
}
public void AddModifier( ModifyingAttribute mod)
{
_mods.Add(mod);
}
private void CalculateModValue()
{
_modValue = 0;
if(_mods.Count > 0)
{
foreach(ModifyingAttribute att in _mods)
_mods += (int)(att.attribute.AdjustedBaseValue * att.ratio);
}
}
public new int AdjustedbaseValue
{
get{ return BaseValue + BuffValue + _modValue; }
}
public void Update()
{
CalculateModValue();
}
}
public struct ModifyingAttribute
{
public Attribute attribute;
public float ratio;
public ModifyingAttribute(Attribute att, float rat)
{
attribute = att;
ratio = rat;
}
}