Dawn of Light - Class documentation 2900
This is the Dawn of Light project
DOL.GS.MerchantTradeItems Class Reference

This class represents a full merchant item list and contains functions that can be used to add and remove items. More...

List of all members.

Public Member Functions

 MerchantTradeItems (string itemsListId)
 Constructor.
virtual bool AddTradeItem (int page, eMerchantWindowSlot slot, ItemTemplate item)
 Adds an item to the merchant item list.
virtual bool RemoveTradeItem (int page, eMerchantWindowSlot slot)
 Removes an item from trade window.
virtual IDictionary GetItemsInPage (int page)
 Get the list of all items in the specified page.
virtual ItemTemplate GetItem (int page, eMerchantWindowSlot slot)
 Get the item in the specified page and slot.
virtual IDictionary GetAllItems ()
 Gets a copy of all intems in trade window.
virtual eMerchantWindowSlot GetValidSlot (int page, eMerchantWindowSlot slot)
 Check if the slot is valid.

Public Attributes

const byte MAX_ITEM_IN_TRADEWINDOWS = 30
 The maximum number of items on one page.
const int MAX_PAGES_IN_TRADEWINDOWS = 5
 The maximum number of pages supported by clients.

Protected Attributes

string m_itemsListID
 Item list id.
HybridDictionary m_usedItemsTemplates = new HybridDictionary()
 Holds item template instances defined with script.

Properties

string ItemsListID [get]
 Item list id.

Detailed Description

This class represents a full merchant item list and contains functions that can be used to add and remove items.


Constructor & Destructor Documentation

DOL.GS.MerchantTradeItems.MerchantTradeItems ( string  itemsListId)

Constructor.

Parameters:
itemsListId

Member Function Documentation

virtual bool DOL.GS.MerchantTradeItems.AddTradeItem ( int  page,
eMerchantWindowSlot  slot,
ItemTemplate  item 
) [virtual]

Adds an item to the merchant item list.

Parameters:
pageZero-based page number
slotZero-based slot number
itemThe item template to add
virtual IDictionary DOL.GS.MerchantTradeItems.GetAllItems ( ) [virtual]

Gets a copy of all intems in trade window.

Returns:
A list where key is the slot position and value is the ItemTemplate
virtual ItemTemplate DOL.GS.MerchantTradeItems.GetItem ( int  page,
eMerchantWindowSlot  slot 
) [virtual]

Get the item in the specified page and slot.

Parameters:
pageThe item page
slotThe item slot
Returns:
Item template or null
virtual IDictionary DOL.GS.MerchantTradeItems.GetItemsInPage ( int  page) [virtual]

Get the list of all items in the specified page.

virtual eMerchantWindowSlot DOL.GS.MerchantTradeItems.GetValidSlot ( int  page,
eMerchantWindowSlot  slot 
) [virtual]

Check if the slot is valid.

Parameters:
pageZero-based page number
slotSlotPosition to check
Returns:
the slot if it's valid or eMerchantWindowSlot.Invalid if not
virtual bool DOL.GS.MerchantTradeItems.RemoveTradeItem ( int  page,
eMerchantWindowSlot  slot 
) [virtual]

Removes an item from trade window.

Parameters:
pageZero-based page number
slotZero-based slot number
Returns:
true if removed

Member Data Documentation

Item list id.

HybridDictionary DOL.GS.MerchantTradeItems.m_usedItemsTemplates = new HybridDictionary() [protected]

Holds item template instances defined with script.

The maximum number of items on one page.

The maximum number of pages supported by clients.


Property Documentation

string DOL.GS.MerchantTradeItems.ItemsListID [get]

Item list id.


The documentation for this class was generated from the following file:
All Classes Namespaces Functions Variables Enumerations Properties Events