Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | List of all members
cItems Class Reference

This class bridges a vector of cItem for safe access via Lua. More...

#include <Item.h>

Inheritance diagram for cItems:
Inheritance graph
[legend]
Collaboration diagram for cItems:
Collaboration graph
[legend]

Public Member Functions

void Add (const cItem &a_Item)
 
void Add (short a_ItemType)
 
void Add (short a_ItemType, char a_ItemCount)
 
void Add (short a_ItemType, char a_ItemCount, short a_ItemDamage)
 
void AddItemGrid (const cItemGrid &a_ItemGrid)
 Adds a copy of all items in a_ItemGrid. More...
 
 cItems (cItem &&a_InitialItem)
 Constructs a new instance containing the specified item. More...
 
 cItems (cItems &&)=default
 
 cItems (const cItems &)=default
 
 cItems (void)
 Need a Lua-accessible constructor. More...
 
void Clear (void)
 
bool Contains (const cItem &a_Item)
 
bool ContainsType (const cItem &a_Item)
 
void Delete (int a_Idx)
 
cItemGet (int a_Idx)
 
cItemsoperator= (cItems &&)=default
 
cItemsoperator= (const cItems &)=default
 
void Set (int a_Idx, const cItem &a_Item)
 
void Set (int a_Idx, short a_ItemType, char a_ItemCount, short a_ItemDamage)
 
size_t Size (void) const
 

Detailed Description

This class bridges a vector of cItem for safe access via Lua.

It checks boundaries for all accesses Note that this class is zero-indexed!

Definition at line 213 of file Item.h.

Constructor & Destructor Documentation

◆ cItems() [1/4]

cItems::cItems ( const cItems )
default

◆ cItems() [2/4]

cItems::cItems ( cItems &&  )
default

◆ cItems() [3/4]

cItems::cItems ( cItem &&  a_InitialItem)

Constructs a new instance containing the specified item.

Definition at line 706 of file Item.cpp.

◆ cItems() [4/4]

cItems::cItems ( void  )
inline

Need a Lua-accessible constructor.

Definition at line 229 of file Item.h.

Member Function Documentation

◆ Add() [1/4]

void cItems::Add ( const cItem a_Item)
inline

Definition at line 233 of file Item.h.

◆ Add() [2/4]

void cItems::Add ( short  a_ItemType)
inline

Definition at line 234 of file Item.h.

◆ Add() [3/4]

void cItems::Add ( short  a_ItemType,
char  a_ItemCount 
)
inline

Definition at line 235 of file Item.h.

◆ Add() [4/4]

void cItems::Add ( short  a_ItemType,
char  a_ItemCount,
short  a_ItemDamage 
)
inline

Definition at line 243 of file Item.h.

◆ AddItemGrid()

void cItems::AddItemGrid ( const cItemGrid a_ItemGrid)

Adds a copy of all items in a_ItemGrid.

Definition at line 803 of file Item.cpp.

◆ Clear()

void cItems::Clear ( void  )
inline

Definition at line 237 of file Item.h.

◆ Contains()

bool cItems::Contains ( const cItem a_Item)

Definition at line 771 of file Item.cpp.

◆ ContainsType()

bool cItems::ContainsType ( const cItem a_Item)

Definition at line 787 of file Item.cpp.

◆ Delete()

void cItems::Delete ( int  a_Idx)

Definition at line 743 of file Item.cpp.

◆ Get()

cItem * cItems::Get ( int  a_Idx)

Definition at line 715 of file Item.cpp.

◆ operator=() [1/2]

cItems& cItems::operator= ( cItems &&  )
default

◆ operator=() [2/2]

cItems& cItems::operator= ( const cItems )
default

◆ Set() [1/2]

void cItems::Set ( int  a_Idx,
const cItem a_Item 
)

Definition at line 729 of file Item.cpp.

◆ Set() [2/2]

void cItems::Set ( int  a_Idx,
short  a_ItemType,
char  a_ItemCount,
short  a_ItemDamage 
)

Definition at line 757 of file Item.cpp.

◆ Size()

size_t cItems::Size ( void  ) const
inline

Definition at line 238 of file Item.h.


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