using System; using System.Diagnostics; using LavishScriptAPI; using MRBot.IsxEq2.Helpers; namespace MRBot.IsxEq2.InventoryConsignment { /// /// Represents an item in a ContainerWindow (Supply Depot Items). Only available when the ContainerWindow is open. /// public class ContainerWindowItem : LavishScriptObject { #region Constructor /// /// Constructor /// /// LS Object public ContainerWindowItem(LavishScriptObject copy) : base(copy) { } #endregion #region Members /// /// Cache of ID /// private int? _iD; /// /// Item ID. Note: The 'ID' MEMBER of the 'containerwindowitem' datatype is used /// exlusively for the "RemoveItem" METHOD of the 'containerwindow' datatype. /// public int ID { get { Trace.WriteLine(String.Format("ContainerWindowItem:ID")); if(!_iD.HasValue) _iD = this.GetIntFromLSO("ID"); return _iD.Value; } } /// /// Cache of Level /// private int? _level; /// /// Item Level (Tier?) /// public int Level { get { Trace.WriteLine(String.Format("ContainerWindowItem:Level")); if(!_level.HasValue) _level = this.GetIntFromLSO("Level"); return _level.Value; } } /// /// Item Quantity /// public int LinkID { get { Trace.WriteLine(String.Format("ContainerWindowItem:LinkID")); return this.GetIntFromLSO("LinkID"); } } /// /// Cache of Name /// private string _name; /// /// Item Name /// public string Name { get { Trace.WriteLine(String.Format("ContainerWindowItem:Name")); return _name ?? (_name = this.GetStringFromLSO("Name")); } } /// /// Item Quantity /// public int Quantity { get { Trace.WriteLine(String.Format("ContainerWindowItem:Quantity")); return this.GetIntFromLSO("Quantity"); } } #endregion } }