using System; using System.Diagnostics; using LavishScriptAPI; using MRBot.IsxEq2.Helpers; namespace MRBot.IsxEq2.AbilityEffect { /// /// This DataType includes all of the data available to ISXEQ2 that is related to Achievements. /// public class Achievement : LavishScriptObject { #region Constructor /// /// Constructor /// /// LS Object public Achievement(LavishScriptObject copy) : base(copy) { } #endregion #region Members /// /// Cache of description /// private string _description; /// /// Achievement Description /// public string Description { get { Trace.WriteLine(String.Format("Achievement:Description")); return _description ?? (_description = this.GetStringFromLSO("Description")); } } /// /// Cache of ID /// private int? _iD; /// /// Achievement ID /// public int ID { get { Trace.WriteLine(String.Format("Achievement:ID")); if(!_iD.HasValue) _iD = this.GetIntFromLSO("ID"); return _iD.Value; } } /// /// Cache of Level /// private int? _level; /// /// Achievement level /// public int Level { get { Trace.WriteLine(String.Format("Achievement:Level")); if(!_level.HasValue) _level = this.GetIntFromLSO("Level"); return _level.Value; } } /// /// Cache of MaxLevel /// private int? _maxLevel; /// /// Max Level of the Achievement /// public int MaxLevel { get { Trace.WriteLine(String.Format("Achievement:MaxLevel")); if(!_maxLevel.HasValue) _maxLevel = this.GetIntFromLSO("MaxLevel"); return _maxLevel.Value; } } /// /// Cache of Name /// private string _name; /// /// Achievement name /// public string Name { get { Trace.WriteLine(String.Format("Achievement:Name")); return _name ?? (_name = this.GetStringFromLSO("Name")); } } /// /// Cache of PointCostPerLevel /// private int? _pointCostPerLevel; /// /// Achievement point cost per level /// public int PointCostPerLevel { get { Trace.WriteLine(String.Format("Achievement:PointCostPerLevel")); if(!_pointCostPerLevel.HasValue) _pointCostPerLevel = this.GetIntFromLSO("PointCostPerLevel"); return _pointCostPerLevel.Value; } } /// /// Cache of ReqLevelToBuy /// private int? _reqLevelToBuy; /// /// Requred level to purchase the Achievement /// public int ReqLevelToBuy { get { Trace.WriteLine(String.Format("Achievement:ReqLevelToBuy")); if(!_reqLevelToBuy.HasValue) _reqLevelToBuy = this.GetIntFromLSO("ReqLevelToBuy"); return _reqLevelToBuy.Value; } } /// /// Returns the achievement as an ability /// /// ability public Ability ToAbility { get { Trace.WriteLine(String.Format("Achievement:ToAbility")); return new Ability(this.GetMember("ToAbility")); } } #endregion #region Methods /// /// Examines the achievement /// /// call success public bool Examine() { Trace.WriteLine(String.Format("Achievement:Examine()")); return this.ExecuteMethod("Examine"); } #endregion } }