19 #include "../clib/compilerspecifics.h" 20 #include "../clib/rawtypes.h" 31 #define CONTAINER_STORES_ITEMREF 0 33 #if CONTAINER_STORES_ITEMREF 34 #define GET_ITEM_PTR( itr ) ( ( *itr ).get() ) 35 #define ITEM_ELEM_PTR( elem ) ( elem.get() ) 36 #define EMPTY_ELEM ItemRef( 0 ) 38 #define GET_ITEM_PTR( itr ) ( *itr ) 39 #define ITEM_ELEM_PTR( elem ) ( elem ) 93 bool send_aos_tooltip );
112 void destroy_contents();
117 virtual
void builtin_on_use( Network::
Client* client ) POL_OVERRIDE;
120 virtual
bool can_add( const Items::
Item& item ) const;
121 virtual
bool can_add(
unsigned short more_weight ) const;
123 virtual
void spill_contents( Multi::UMulti* supporting_multi ) POL_OVERRIDE;
125 virtual
void add( Items::
Item* item );
126 void add_at_random_location( Items::
Item* item );
127 unsigned count() const;
129 virtual
unsigned int item_count() const POL_OVERRIDE;
130 virtual
unsigned int weight() const POL_OVERRIDE;
132 bool can_add_bulk(
int tli_diff,
int item_count_diff,
int weight_diff ) const;
133 virtual
void add_bulk(
int item_count_delta,
int weight_delta );
134 void add_bulk( const Items::
Item* item );
135 void remove_bulk( const Items::
Item* item );
137 bool can_add_to_slot(
u8& slotIndex );
138 bool is_slot_empty(
u8& slotIndex );
139 bool find_empty_slot(
u8& slotIndex );
141 Items::
Item* find(
u32 serial ) const;
142 Items::
Item* find_toplevel(
u32 serial ) const;
143 Items::
Item* find_toplevel_objtype(
u32 objtype ) const;
144 Items::
Item* find_toplevel_objtype(
u32 objtype,
unsigned short maxamount ) const;
145 Items::
Item* find_toplevel_polclass(
unsigned int polclass ) const;
146 Items::
Item* find_addable_stack( const Items::
Item* adding_item ) const;
148 Items::
Item* find_toplevel_objtype_noninuse(
u32 objtype ) const;
149 Items::
Item* find_toplevel_objtype_noninuse(
u32 objtype,
unsigned short maxamount ) const;
150 Items::
Item* find_objtype_noninuse(
u32 objtype ) const;
151 Items::
Item* find_objtype(
u32 objtype,
int flags ) const;
153 virtual
void for_each_item(
void ( *f )(
Item* item,
void* a ),
void* arg );
155 virtual
bool script_isa(
unsigned isatype ) const POL_OVERRIDE;
156 virtual Items::
Item* clone() const POL_OVERRIDE;
158 unsigned int find_sumof_objtype_noninuse(
u32 objtype ) const;
159 unsigned int find_sumof_objtype_noninuse(
u32 objtype,
u32 amtToGet, Contents& saveItemsTo,
161 void consume_sumof_objtype_noninuse(
u32 objtype,
unsigned int amount );
168 virtual
void remove( Items::
Item* item );
169 virtual
void remove( iterator itr );
192 unsigned short amt_to_add,
Items::Item* adding_item );
196 unsigned short amt_added );
204 void get_random_location(
u16* px,
u16* py )
const;
209 bool can_swap(
const UContainer& cont )
const;
220 unsigned short max_items()
const;
221 unsigned short max_weight()
const;
222 u8 max_slots()
const;
228 bool no_drop_exception()
const;
229 void no_drop_exception(
bool newvalue );
230 bool default_no_drop_exception()
const;
247 friend class UContainerIterator;
250 bool send_aos_tooltip );
252 bool send_aos_tooltip );
269 return static_cast<unsigned>( contents_.size() );
Contents::const_iterator const_iterator
std::vector< Items::Item * > Contents
static Item * create(u32 objtype, u32 serial=0)
const Items::ContainerDesc & desc
bool send_vendorwindow_contents(Network::Client *client, Core::UContainer *for_sale, bool send_aos_tooltip)
const Items::ContainerDesc & descriptor() const
virtual Mobile::Character * get_chr_owner()
Contents::iterator iterator
#define ITEM_ELEM_PTR(elem)
unsigned int held_item_count_
bool send_vendorsell(Client *client, NPC *merchant, UContainer *sellfrom, UContainer *buyable, bool send_aos_tooltip)
#define DYN_PROPERTY(name, type, id, defaultvalue)
Items::Item * operator[](unsigned idx) const