using System; using System.Collections.Generic; using SUISS.Core; using SUISSEngine; public class LevelUpItem : IPackEffect { public LevelUpItem(Dictionary 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.Instance; decimal xpForLevelsUp = instance.GetXpForLevelsUp(this._levels); instance.EarnCurrencies(new Currencies("XP", xpForLevelsUp), null); } } public static LevelUpItem FromStorage(Dictionary dict) { return new LevelUpItem((int)dict["Levels"]); } public Dictionary ToStorage() { return new Dictionary { { "Levels", this.Levels } }; } public const decimal GoldCompensationPerLevel = 50m; public const string LevelsKey = "Levels"; private int _levels; }