Beispiel #1
0
        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);
                }
            }
        }
Beispiel #2
0
        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);
                }
            }
        }