OpenEnroth 4aaa0a0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
InventoryConstEntry Class Reference

#include <Inventory.h>

Inheritance diagram for InventoryConstEntry:
InventoryEntry

Public Member Functions

 InventoryConstEntry ()=default
 
 operator bool () const
 
const Itemoperator-> () const
 
const Itemoperator* () const
 
const Itemget () const
 
InventoryZone zone () const
 
Recti geometry () const
 
ItemSlot slot () const
 
int index () const
 
bool operator! () const
 
InventoryConstEntryoperator= (std::nullptr_t)
 

Protected Member Functions

 InventoryConstEntry (const Inventory *inventory, int index)
 

Private Attributes

const Inventory_inventory = nullptr
 
int _index = -1
 

Friends

class Inventory
 

Detailed Description

Lightweight, pointer‑like descriptor giving const access to an item owned by an Inventory.

InventoryConstEntry can be in an invalid state, index() will return -1 in this case, all other methods will assert. Check for validity with operator bool.

Constructor & Destructor Documentation

◆ InventoryConstEntry() [1/2]

InventoryConstEntry::InventoryConstEntry ( )
default

◆ InventoryConstEntry() [2/2]

InventoryConstEntry::InventoryConstEntry ( const Inventory inventory,
int  index 
)
inlineprotected

Member Function Documentation

◆ geometry()

Recti InventoryConstEntry::geometry ( ) const
inline

◆ get()

const Item * InventoryConstEntry::get ( ) const
inline

◆ index()

int InventoryConstEntry::index ( ) const
inline

◆ operator bool()

InventoryConstEntry::operator bool ( ) const
inlineexplicit

◆ operator!()

bool InventoryConstEntry::operator! ( ) const
inline

◆ operator*()

const Item & InventoryConstEntry::operator* ( ) const
inline

◆ operator->()

const Item * InventoryConstEntry::operator-> ( ) const
inline

◆ operator=()

InventoryConstEntry & InventoryConstEntry::operator= ( std::nullptr_t  )
inline

◆ slot()

ItemSlot InventoryConstEntry::slot ( ) const
inline

◆ zone()

InventoryZone InventoryConstEntry::zone ( ) const
inline

Friends And Related Function Documentation

◆ Inventory

friend class Inventory
friend

Member Data Documentation

◆ _index

int InventoryConstEntry::_index = -1
private

◆ _inventory

const Inventory* InventoryConstEntry::_inventory = nullptr
private

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