khoiK
Normal8mo ago
15 replies
khoi

"Incrementing" a value on a model

If I have a private int _damage on a model, and then I do the following code:
public void AddDamageToModel(int damage)
{
SetDamage(model.damage + damage);
}
public void SetDamage(int damage)
{
model.damage = damage;
}

And multiple clients call this function. What happens? Will it sequentially increment without overriding each other?
Was this page helpful?