Class Item

Class Documentation

class game::item::Item

Public Functions

Item(std::shared_ptr<ItemManager> manager, formats::Item proto, uint32_t owner, uint64_t id, uint8_t count = 1)
void Send(const std::shared_ptr<core::networking::Connection> &connection) const

Send this item as a set command to the client.

void SendRemove(const std::shared_ptr<core::networking::Connection> &connection) const
uint8_t Add(uint8_t count)

Increase the count and returns the new count.

uint8_t Remove(uint8_t count)

Decrease the count and returns the new count. If the returned count is zero the item got removed

void Destroy()

Removes the item.

void Persist(bool create = false)

Saves the item to the redis cache

  • create: Currently unused but should only be used by ItemManager!

uint64_t GetId() const
const formats::Item &GetProto() const
uint16_t GetPosition() const
void SetPosition(uint16_t position)
uint16_t GetWindow() const
void SetWindow(uint16_t window)

Public Static Functions

void SendRemove(uint8_t window, uint16_t position, const std::shared_ptr<core::networking::Connection> &connection)