|
- using System;
- using System.Collections.Generic;
- using SUISS.Core;
- using SUISSEngine;
-
- public class LevelUpItem : IPackEffect
- {
- public LevelUpItem(Dictionary<string, object> props)
- {
- this._levels = (int)((double)props["Levels"]);
- }
-
- public LevelUpItem(int levels)
- {
- this._levels = levels;
- }
-
- public int Levels
- {
- get
- {
- return this._levels;
- }
- }
-
- public void ApplyEffect()
- {
- if (this._levels > 0)
- {
- CIGGameState instance = SingletonMonobehaviour<CIGGameState>.Instance;
- decimal xpForLevelsUp = instance.GetXpForLevelsUp(this._levels);
- instance.EarnCurrencies(new Currencies("XP", xpForLevelsUp), null);
- }
- }
-
- public static LevelUpItem FromStorage(Dictionary<string, object> dict)
- {
- return new LevelUpItem((int)dict["Levels"]);
- }
-
- public Dictionary<string, object> ToStorage()
- {
- return new Dictionary<string, object>
- {
- {
- "Levels",
- this.Levels
- }
- };
- }
-
- public const decimal GoldCompensationPerLevel = 50m;
-
- public const string LevelsKey = "Levels";
-
- private int _levels;
- }
|