ManaPlus
Public Member Functions
SortListModelInv Class Reference

#include <sortlistmodelinv.h>

Inheritance diagram for SortListModelInv:
ListModel

Public Member Functions

 SortListModelInv ()
 
int getNumberOfElements ()
 
std::string getElementAt (int i)
 
- Public Member Functions inherited from ListModel
 ListModel ()
 
virtual ~ListModel ()
 

Detailed Description

Definition at line 46 of file sortlistmodelinv.h.

Constructor & Destructor Documentation

◆ SortListModelInv()

SortListModelInv::SortListModelInv ( )
inline

Definition at line 49 of file sortlistmodelinv.h.

49  :
50  ListModel()
51  { }
ListModel()
Definition: listmodel.h:82

Member Function Documentation

◆ getElementAt()

std::string SortListModelInv::getElementAt ( int  i)
inlinevirtual

Gets an element at a certain index in the list.

Parameters
iAn index in the list.
Returns
An element as a string at the a certain index.

Implements ListModel.

Definition at line 58 of file sortlistmodelinv.h.

59  {
60  if (i >= getNumberOfElements() || i < 0)
61  return "???";
62 
63  return gettext(SORT_NAME_INVENTORY[i]);
64  }
static const char *const SORT_NAME_INVENTORY[6]

References getNumberOfElements(), and SORT_NAME_INVENTORY.

◆ getNumberOfElements()

int SortListModelInv::getNumberOfElements ( )
inlinevirtual

Gets the number of elements in the list.

Returns
The number of elements in the list

Implements ListModel.

Definition at line 55 of file sortlistmodelinv.h.

56  { return 6; }

Referenced by getElementAt().


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