ManaPlus
Public Member Functions
PlayerRelationListModel Class Reference

#include <playerrelationlistmodel.h>

Inheritance diagram for PlayerRelationListModel:
ListModel

Public Member Functions

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

Detailed Description

Definition at line 51 of file playerrelationlistmodel.h.

Constructor & Destructor Documentation

◆ PlayerRelationListModel()

PlayerRelationListModel::PlayerRelationListModel ( )
inline

Definition at line 54 of file playerrelationlistmodel.h.

54  :
55  ListModel()
56  { }
ListModel()
Definition: listmodel.h:82

Member Function Documentation

◆ getElementAt()

std::string PlayerRelationListModel::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 65 of file playerrelationlistmodel.h.

66  {
67  if (i >= getNumberOfElements() || i < 0)
68  return "";
69  return gettext(RELATION_NAMES[i]);
70  }
static const char *const RELATION_NAMES[PlayerRelation::RELATIONS_NR]

References getNumberOfElements(), and RELATION_NAMES.

◆ getNumberOfElements()

int PlayerRelationListModel::getNumberOfElements ( )
inlinevirtual

Gets the number of elements in the list.

Returns
The number of elements in the list

Implements ListModel.

Definition at line 60 of file playerrelationlistmodel.h.

61  {
63  }
static const unsigned int RELATIONS_NR

References PlayerRelation::RELATIONS_NR.

Referenced by getElementAt().


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