using System; using System.Diagnostics; using LavishScriptAPI; using MRBot.IsxEq2.Helpers; namespace MRBot.IsxEq2.Recipe { /// /// This DataType includes all of the data available to ISXEQ2 that is related to tradeskill recipe components. /// public class Component : LavishScriptObject { #region Constructor /// /// Constructor /// /// LS Object public Component(LavishScriptObject copy) : base(copy) { } #endregion #region Members /// /// Cache of Name /// private string _name; /// /// Component name /// public string Name { get { Trace.WriteLine(String.Format("Component:Name")); return _name ?? (_name = this.GetStringFromLSO("Name")); } } /// /// Cache of Quantity /// private int? _quantity; /// /// Quantity of component required /// public int Quantity { get { Trace.WriteLine(String.Format("Component:Quantity")); if(!_quantity.HasValue) _quantity = this.GetIntFromLSO("Quantity"); return _quantity.Value; } } /// /// The quantity of the compoent on hand /// public int QuantityOnHand { get { Trace.WriteLine(String.Format("Component:QuantityOnHand")); return this.GetIntFromLSO("QuantityOnHand"); } } #endregion } }