Mana
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ItemShortcut Class Reference

The class which keeps track of the item shortcuts. More...

#include <itemshortcut.h>

Public Member Functions

 ItemShortcut ()
 
 ~ItemShortcut ()
 
void load ()
 Load the configuration information.
 
int getItem (int index) const
 Returns the shortcut item ID specified by the index.
 
int getItemCount () const
 Returns the amount of shortcut items.
 
int getItemSelected () const
 Returns the item ID that is currently selected.
 
void setItem (int index)
 Adds the selected item ID to the items specified by the index.
 
void setItems (int index, int itemId)
 Adds an item to the items store specified by the index.
 
void setItemSelected (int itemId)
 Set the item that is selected.
 
bool isItemSelected ()
 A flag to check if the item is selected.
 
void removeItem (int index)
 Remove a item from the shortcut.
 
void useItem (int index)
 Try to use the item specified by the index.
 

Private Member Functions

void save ()
 Save the configuration information.
 

Private Attributes

int mItems [SHORTCUT_ITEMS]
 The items stored.
 
int mItemSelected = -1
 The item held by cursor.
 

Detailed Description

The class which keeps track of the item shortcuts.

Definition at line 29 of file itemshortcut.h.

Constructor & Destructor Documentation

◆ ItemShortcut()

ItemShortcut::ItemShortcut ( )

Definition at line 32 of file itemshortcut.cpp.

◆ ~ItemShortcut()

ItemShortcut::~ItemShortcut ( )

Definition at line 37 of file itemshortcut.cpp.

Member Function Documentation

◆ getItem()

int ItemShortcut::getItem ( int  index) const
inline

Returns the shortcut item ID specified by the index.

Parameters
indexIndex of the shortcut item.

Definition at line 46 of file itemshortcut.h.

◆ getItemCount()

int ItemShortcut::getItemCount ( ) const
inline

Returns the amount of shortcut items.

Definition at line 52 of file itemshortcut.h.

◆ getItemSelected()

int ItemShortcut::getItemSelected ( ) const
inline

Returns the item ID that is currently selected.

Definition at line 58 of file itemshortcut.h.

◆ isItemSelected()

bool ItemShortcut::isItemSelected ( )
inline

A flag to check if the item is selected.

Definition at line 89 of file itemshortcut.h.

◆ load()

void ItemShortcut::load ( )

Load the configuration information.

Definition at line 42 of file itemshortcut.cpp.

◆ removeItem()

void ItemShortcut::removeItem ( int  index)
inline

Remove a item from the shortcut.

Definition at line 95 of file itemshortcut.h.

◆ save()

void ItemShortcut::save ( )
private

Save the configuration information.

Definition at line 54 of file itemshortcut.cpp.

◆ setItem()

void ItemShortcut::setItem ( int  index)
inline

Adds the selected item ID to the items specified by the index.

Parameters
indexIndex of the items.

Definition at line 66 of file itemshortcut.h.

◆ setItems()

void ItemShortcut::setItems ( int  index,
int  itemId 
)
inline

Adds an item to the items store specified by the index.

Parameters
indexIndex of the item.
itemIdID of the item.

Definition at line 75 of file itemshortcut.h.

◆ setItemSelected()

void ItemShortcut::setItemSelected ( int  itemId)
inline

Set the item that is selected.

Parameters
itemIdThe ID of the item that is to be assigned.

Definition at line 83 of file itemshortcut.h.

◆ useItem()

void ItemShortcut::useItem ( int  index)

Try to use the item specified by the index.

Parameters
indexIndex of the item shortcut.

Definition at line 65 of file itemshortcut.cpp.

Member Data Documentation

◆ mItems

int ItemShortcut::mItems[SHORTCUT_ITEMS]
private

The items stored.

Definition at line 111 of file itemshortcut.h.

◆ mItemSelected

int ItemShortcut::mItemSelected = -1
private

The item held by cursor.

Definition at line 112 of file itemshortcut.h.


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