public void SetExp(int count) { int prevLevel = level; int oldExp = exp; exp = count; int newLevel = level; if (oldExp != exp) { RavenhillEvents.OnPlayerExpChanged(oldExp, exp); if (oldExp != newLevel) { RavenhillEvents.OnPlayerLevelChanged(prevLevel, newLevel); } } }
private void AddExpImpl(int count) { int prevLevel = level; int oldExp = exp; exp += count; int newLevel = level; if (oldExp != exp) { RavenhillEvents.OnPlayerExpChanged(oldExp, exp); if (oldExp != newLevel) { RavenhillEvents.OnPlayerLevelChanged(prevLevel, newLevel); } } }