ManaPlus
Public Member Functions
TargetTypeModel Class Reference

#include <targettypemodel.h>

Inheritance diagram for TargetTypeModel:
ListModel

Public Member Functions

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

Detailed Description

Definition at line 39 of file targettypemodel.h.

Constructor & Destructor Documentation

◆ TargetTypeModel()

TargetTypeModel::TargetTypeModel ( )
inline

Definition at line 42 of file targettypemodel.h.

42  :
43  ListModel()
44  { }
ListModel()
Definition: listmodel.h:82

Member Function Documentation

◆ getElementAt()

std::string TargetTypeModel::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 53 of file targettypemodel.h.

54  {
55  if (i >= getNumberOfElements() || i < 0)
56  return "???";
57  return TARGET_TYPE_TEXT[i];
58  }
const char * TARGET_TYPE_TEXT[3]

References getNumberOfElements(), and TARGET_TYPE_TEXT.

◆ getNumberOfElements()

int TargetTypeModel::getNumberOfElements ( )
inlinevirtual

Gets the number of elements in the list.

Returns
The number of elements in the list

Implements ListModel.

Definition at line 48 of file targettypemodel.h.

49  {
50  return 3;
51  }

Referenced by getElementAt().


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