ManaPlus
beingslistmodel.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2010 The Mana Developers
4  * Copyright (C) 2011-2019 The ManaPlus Developers
5  *
6  * This file is part of The ManaPlus Client.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef GUI_MODELS_BEINGSLISTMODEL_H
23 #define GUI_MODELS_BEINGSLISTMODEL_H
24 
26 
27 #include "utils/cast.h"
28 #include "utils/dtor.h"
29 #include "utils/vector.h"
30 
32 {
33  public:
36  mMembers()
37  {
38  }
39 
41 
43  {
45  mMembers.clear();
46  }
47 
48  STD_VECTOR<Avatar*> *getMembers() RETURNS_NONNULL A_WARN_UNUSED
49  {
50  return &mMembers;
51  }
52 
53  Avatar *getAvatarAt(int index) override final
54  {
55  return mMembers[index];
56  }
57 
59  {
60  return CAST_S32(mMembers.size());
61  }
62 
63  STD_VECTOR<Avatar*> mMembers;
64 };
65 
66 #endif // GUI_MODELS_BEINGSLISTMODEL_H
cast.h
avatarlistmodel.h
A_DELETE_COPY
#define A_DELETE_COPY(func)
Definition: localconsts.h:52
BeingsListModel::~BeingsListModel
~BeingsListModel()
Definition: beingslistmodel.h:42
final
#define final
Definition: localconsts.h:45
AvatarListModel
Definition: avatarlistmodel.h:29
BeingsListModel::getNumberOfElements
int getNumberOfElements()
Definition: beingslistmodel.h:58
BeingsListModel::BeingsListModel
BeingsListModel()
Definition: beingslistmodel.h:34
BeingsListModel::getAvatarAt
Avatar * getAvatarAt(int index)
Definition: beingslistmodel.h:53
RETURNS_NONNULL
#define RETURNS_NONNULL
Definition: localconsts.h:166
delete_all
void delete_all(Container &c)
Definition: dtor.h:55
override
#define override
Definition: localconsts.h:46
Avatar
Definition: avatar.h:39
BeingsListModel::mMembers
std::vector< Avatar * > mMembers
Definition: beingslistmodel.h:63
vector.h
BeingsListModel::getMembers
std::vector< Avatar * > * getMembers()
Definition: beingslistmodel.h:48
CAST_S32
#define CAST_S32
Definition: cast.h:29
BeingsListModel
Definition: beingslistmodel.h:31
A_WARN_UNUSED
#define A_WARN_UNUSED
Definition: localconsts.h:160
dtor.h