using System; using System.Diagnostics; using System.Globalization; using LavishScriptAPI; using MRBot.IsxEq2.Helpers; using MRBot.IsxEq2.UI; namespace MRBot.IsxEq2.InventoryConsignment { /// /// This TLO returns a new datatype: 'eq2brokerwindow'. This new datatype inherits all members/methods of the 'eq2window' type. /// public class BrokerWindow : EQ2Window { #region Constructor /// /// Constructor - Copies the LavishScript object /// /// LS Object public BrokerWindow(LavishScriptObject Obj) : base(Obj) { } /// /// Constructor - Constructs a BrokerWindow object based on the LavishScript object BrokerWindow /// public BrokerWindow() : base(LavishScript.Objects.GetObject("BrokerWindow")) { } #endregion #region Members /// /// number of items returned by search (usually 0 to 8) /// public int NumSearchResults { get { Trace.WriteLine(String.Format("BrokerWindow:NumSearchResults")); return this.GetIntFromLSO("NumSearchResults"); } } /// /// number of the current search page /// public int CurrentSearchPage { get { Trace.WriteLine(String.Format("BrokerWindow:CurrentSearchPage")); return this.GetIntFromLSO("CurrentSearchPage"); } } /// /// number of total search pages /// public int TotalSearchPages { get { Trace.WriteLine(String.Format("BrokerWindow:TotalSearchPages")); return this.GetIntFromLSO("TotalSearchPages"); } } /// /// This member returns either a 'consignment' or 'merchandise' object that the /// broker or vendor is currently capable of selling (on the current 'Search Page' /// only, for broker) based upon the index. Only the members and methods they have /// in common are available. /// /// index /// call success public Consignment SearchResult(int index) { Trace.WriteLine(String.Format("BrokerWindow:SearchResult({0})", index.ToString(CultureInfo.InvariantCulture))); return new Consignment(this.GetMember("SearchResult", index.ToString(CultureInfo.InvariantCulture))); } /// /// This member returns either a 'consignment' or 'merchandise' object that the /// broker or vendor is currently capable of selling (on the current 'Search Page' /// only, for broker) based upon an exact match of the item name. Only the members /// and methods they have in common are available. /// /// name /// call success public Consignment SearchResult(string name) { Trace.WriteLine(String.Format("BrokerWindow:SearchResult({0})", name)); return new Consignment(this.GetMember("SearchResult", name)); } /// /// Number of your vending containers /// public int NumVendingContainers { get { Trace.WriteLine(String.Format("BrokerWindow:NumVendingContainers")); return this.GetIntFromLSO("NumVendingContainers"); } } /// /// Number of items for sale (use with Broker or Merchant 1 to NumItemsForSale) /// public int NumItemsForSale { get { Trace.WriteLine(String.Format("BrokerWindow:NumItemsForSale")); return this.GetIntFromLSO("NumItemsForSale"); } } /// /// total capacity for the current selected vendor container /// public int TotalVendingCapacity { get { Trace.WriteLine(String.Format("BrokerWindow:TotalVendingCapacity")); return this.GetIntFromLSO("TotalVendingCapacity"); } } /// /// free slots left in the current selected vendor container /// public int VendingCapacityFree { get { Trace.WriteLine(String.Format("BrokerWindow:VendingCapacityFree")); return this.GetIntFromLSO("VendingCapacityFree"); } } /// /// slots currently used in the current selected vendor container /// public int VendingCapacityUsed { get { Trace.WriteLine(String.Format("BrokerWindow:VendingCapacityUsed")); return this.GetIntFromLSO("VendingCapacityUsed"); } } /// /// # is between 1 and NumVendingContainers (or 6, if you prefer to use the maximum) /// /// index /// call success public VendingContainer VendingContainer(int index) { Trace.WriteLine(String.Format("BrokerWindow:VendingContainer({0})", index.ToString(CultureInfo.InvariantCulture))); return new VendingContainer(this.GetMember("VendingContainer", index.ToString(CultureInfo.InvariantCulture))); } /// /// name is the name of the vending container /// /// name /// call success public VendingContainer VendingContainer(string name) { Trace.WriteLine(String.Format("BrokerWindow:VendingContainer({0})", name)); return new VendingContainer(this.GetMember("VendingContainer", name)); } #endregion #region Methods /// /// Selects the indicated page between 1 and TotalSearchPages (Broker Only) /// /// page /// call success public bool GotoSearchPage(int page) { Trace.WriteLine(String.Format("BrokerWindow:GotoSearchPage({0})", page.ToString(CultureInfo.InvariantCulture))); return this.ExecuteMethod("GotoSearchPage", page.ToString(CultureInfo.InvariantCulture)); } /// /// Changes the active vendor container (Broker Only) /// /// index /// call success public bool ChangeActiveVendingContainer(int index) { Trace.WriteLine(String.Format("BrokerWindow:ChangeActiveVendingContainer({0})", index.ToString(CultureInfo.InvariantCulture))); return this.ExecuteMethod("ChangeActiveVendingContainer", index.ToString(CultureInfo.InvariantCulture)); } #endregion } }