ManaPlus
Public Member Functions
ColorListModel Class Reference

#include <colorlistmodel.h>

Inheritance diagram for ColorListModel:
ListModel

Public Member Functions

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

Detailed Description

Definition at line 63 of file colorlistmodel.h.

Constructor & Destructor Documentation

◆ ColorListModel()

ColorListModel::ColorListModel ( )
inline

Definition at line 66 of file colorlistmodel.h.

66  :
67  ListModel()
68  { }
ListModel()
Definition: listmodel.h:82

Member Function Documentation

◆ getElementAt()

std::string ColorListModel::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 77 of file colorlistmodel.h.

78  {
79  if (i >= getNumberOfElements() || i < 0)
80  return "???";
81  return gettext(COLOR_NAME[i]);
82  }
int getNumberOfElements()
const char * COLOR_NAME[14]

References COLOR_NAME, and getNumberOfElements().

◆ getNumberOfElements()

int ColorListModel::getNumberOfElements ( )
inlinevirtual

Gets the number of elements in the list.

Returns
The number of elements in the list

Implements ListModel.

Definition at line 72 of file colorlistmodel.h.

73  {
74  return 14;
75  }

Referenced by getElementAt().


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