Exemplo n.º 1
0
 private static void LevelUp(ILevalable il)
 {
     if (il.Level == 10)
     {
         il.Exp = 0;
         return;
     }
     il.Level += 1;
 }
Exemplo n.º 2
0
        public static void GrantExp(ILevalable il, int value)
        {
            int ilExp     = il.Exp;
            int nextLevel = Exp[il.Level - 1];

            if (ilExp + value >= nextLevel)
            {
                LevelUp(il);
            }
            else
            {
                il.Exp += value;
            }
        }