Otclient  14/8/2020
Container Class Reference

#include <container.h>

Inheritance diagram for Container:
Collaboration diagram for Container:

Public Member Functions

ItemPtr getItem (int slot)
 
std::deque< ItemPtrgetItems ()
 
int getItemsCount ()
 
Position getSlotPosition (int slot)
 
int getId ()
 
int getCapacity ()
 
ItemPtr getContainerItem ()
 
std::string getName ()
 
bool hasParent ()
 
bool isClosed ()
 
bool isUnlocked ()
 
bool hasPages ()
 
int getSize ()
 
int getFirstIndex ()
 
ItemPtr findItemById (uint itemId, int subType)
 
- Public Member Functions inherited from LuaObject
 LuaObject ()
 
virtual ~LuaObject ()
 
template<typename T >
void connectLuaField (const std::string &field, const std::function< T > &f, bool pushFront=false)
 
template<typename... T>
int luaCallLuaField (const std::string &field, const T &... args)
 
template<typename R , typename... T>
callLuaField (const std::string &field, const T &... args)
 
template<typename... T>
void callLuaField (const std::string &field, const T &... args)
 
bool hasLuaField (const std::string &field)
 Returns true if the lua field exists. More...
 
template<typename T >
void setLuaField (const std::string &key, const T &value)
 Sets a field in this lua object. More...
 
template<typename T >
getLuaField (const std::string &key)
 Gets a field from this lua object. More...
 
void releaseLuaFieldsTable ()
 Release fields table reference. More...
 
void luaSetField (const std::string &key)
 Sets a field from this lua object, the value must be on the stack. More...
 
void luaGetField (const std::string &key)
 Gets a field from this lua object, the result is pushed onto the stack. More...
 
void luaGetMetatable ()
 Get object's metatable. More...
 
void luaGetFieldsTable ()
 Gets the table containing all stored fields of this lua object, the result is pushed onto the stack. More...
 
int getUseCount ()
 
std::string getClassName ()
 Returns the derived class name, its the same name used in Lua. More...
 
LuaObjectPtr asLuaObject ()
 
void operator= (const LuaObject &)
 
- Public Member Functions inherited from stdext::shared_object
 shared_object ()
 
virtual ~shared_object ()
 
void add_ref ()
 
void dec_ref ()
 
refcount_t ref_count ()
 
template<typename T >
stdext::shared_object_ptr< T > static_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > dynamic_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > const_self_cast ()
 

Protected Member Functions

 Container (int id, int capacity, const std::string &name, const ItemPtr &containerItem, bool hasParent, bool isUnlocked, bool hasPages, int containerSize, int firstIndex)
 
void onOpen (const ContainerPtr &previousContainer)
 
void onClose ()
 
void onAddItem (const ItemPtr &item, int slot)
 
void onAddItems (const std::vector< ItemPtr > &items)
 
void onUpdateItem (int slot, const ItemPtr &item)
 
void onRemoveItem (int slot, const ItemPtr &lastItem)
 

Friends

class Game
 

Detailed Description

Definition at line 32 of file container.h.

Constructor & Destructor Documentation

◆ Container()

Container::Container ( int  id,
int  capacity,
const std::string &  name,
const ItemPtr containerItem,
bool  hasParent,
bool  isUnlocked,
bool  hasPages,
int  containerSize,
int  firstIndex 
)
protected

Definition at line 26 of file container.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ findItemById()

ItemPtr Container::findItemById ( uint  itemId,
int  subType 
)

Definition at line 79 of file container.cpp.

◆ getCapacity()

int Container::getCapacity ( )
inline

Definition at line 43 of file container.h.

Here is the caller graph for this function:

◆ getContainerItem()

ItemPtr Container::getContainerItem ( )
inline

Definition at line 44 of file container.h.

Here is the caller graph for this function:

◆ getFirstIndex()

int Container::getFirstIndex ( )
inline

Definition at line 51 of file container.h.

Here is the caller graph for this function:

◆ getId()

int Container::getId ( )
inline

Definition at line 42 of file container.h.

Here is the caller graph for this function:

◆ getItem()

ItemPtr Container::getItem ( int  slot)

Definition at line 40 of file container.cpp.

Here is the caller graph for this function:

◆ getItems()

std::deque<ItemPtr> Container::getItems ( )
inline

Definition at line 39 of file container.h.

Here is the caller graph for this function:

◆ getItemsCount()

int Container::getItemsCount ( )
inline

Definition at line 40 of file container.h.

Here is the caller graph for this function:

◆ getName()

std::string Container::getName ( )
inline

Definition at line 45 of file container.h.

Here is the caller graph for this function:

◆ getSize()

int Container::getSize ( )
inline

Definition at line 50 of file container.h.

Here is the caller graph for this function:

◆ getSlotPosition()

Position Container::getSlotPosition ( int  slot)
inline

Definition at line 41 of file container.h.

Here is the caller graph for this function:

◆ hasPages()

bool Container::hasPages ( )
inline

Definition at line 49 of file container.h.

Here is the caller graph for this function:

◆ hasParent()

bool Container::hasParent ( )
inline

Definition at line 46 of file container.h.

Here is the caller graph for this function:

◆ isClosed()

bool Container::isClosed ( )
inline

Definition at line 47 of file container.h.

Here is the caller graph for this function:

◆ isUnlocked()

bool Container::isUnlocked ( )
inline

Definition at line 48 of file container.h.

Here is the caller graph for this function:

◆ onAddItem()

void Container::onAddItem ( const ItemPtr item,
int  slot 
)
protected

Definition at line 58 of file container.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onAddItems()

void Container::onAddItems ( const std::vector< ItemPtr > &  items)
protected

Definition at line 87 of file container.cpp.

◆ onClose()

void Container::onClose ( )
protected

Definition at line 52 of file container.cpp.

Here is the call graph for this function:

◆ onOpen()

void Container::onOpen ( const ContainerPtr previousContainer)
protected

Definition at line 47 of file container.cpp.

Here is the call graph for this function:

◆ onRemoveItem()

void Container::onRemoveItem ( int  slot,
const ItemPtr lastItem 
)
protected

Definition at line 109 of file container.cpp.

Here is the call graph for this function:

◆ onUpdateItem()

void Container::onUpdateItem ( int  slot,
const ItemPtr item 
)
protected

Definition at line 94 of file container.cpp.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ Game

friend class Game
friend

Definition at line 62 of file container.h.


The documentation for this class was generated from the following files: