ManaPlus
Public Member Functions
MagicSchoolModel Class Reference

#include <magicschoolmodel.h>

Inheritance diagram for MagicSchoolModel:
ListModel

Public Member Functions

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

Detailed Description

Definition at line 48 of file magicschoolmodel.h.

Constructor & Destructor Documentation

◆ MagicSchoolModel()

MagicSchoolModel::MagicSchoolModel ( )
inline

Definition at line 51 of file magicschoolmodel.h.

51  :
52  ListModel()
53  { }
ListModel()
Definition: listmodel.h:82

Member Function Documentation

◆ getElementAt()

std::string MagicSchoolModel::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 62 of file magicschoolmodel.h.

63  {
64  if (i >= getNumberOfElements() || i < 0)
65  return "???";
66  return MAGIC_SCHOOL_TEXT[i];
67  }
const char * MAGIC_SCHOOL_TEXT[6]

References getNumberOfElements(), and MAGIC_SCHOOL_TEXT.

◆ getNumberOfElements()

int MagicSchoolModel::getNumberOfElements ( )
inlinevirtual

Gets the number of elements in the list.

Returns
The number of elements in the list

Implements ListModel.

Definition at line 57 of file magicschoolmodel.h.

58  {
59  return 6;
60  }

Referenced by getElementAt().


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