Crossfire Server, Trunk
CREMessageItemModel.h
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 2022 the Crossfire Development Team
5  *
6  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7  * welcome to redistribute it under certain conditions. For details, please
8  * see COPYING and LICENSE.
9  *
10  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
11  */
12 
13 #ifndef CREMESSAGEITEMMODEL_H
14 #define CREMESSAGEITEMMODEL_H
15 
16 #include <QSet>
17 
18 #include <QObject>
19 #include <QAbstractItemModel>
20 
21 #include "MessageFile.h"
22 
26 class CREMessageItemModel : public QAbstractItemModel
27 {
28  Q_OBJECT
29 public:
30  CREMessageItemModel(QObject* parent);
31  virtual ~CREMessageItemModel();
32 
34 
35  void setSelectedRule(const QModelIndex& index);
36 
37  virtual int columnCount(const QModelIndex& parent) const override;
38  virtual QModelIndex index(int row, int column, const QModelIndex& parent) const override;
39  virtual QModelIndex parent(const QModelIndex& index) const override;
40  virtual int rowCount(const QModelIndex & parent) const override;
41  virtual QVariant data(const QModelIndex& index, int role) const override;
42  virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
43  virtual Qt::ItemFlags flags(const QModelIndex& index) const override;
44  virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
45  virtual bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex()) override;
46  virtual bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()) override;
47 
48  void moveUpDown(int row, bool up);
49  void duplicateRow(int row);
50 
51 protected:
53  QSet<int> myBlue, myRed;
54 };
55 
56 #endif /* CREMESSAGEITEMMODEL_H */
57 
CREMessageItemModel::CREMessageItemModel
CREMessageItemModel(QObject *parent)
Definition: CREMessageItemModel.cpp:17
MessageFile.h
CREMessageItemModel
Definition: CREMessageItemModel.h:26
CREMessageItemModel::~CREMessageItemModel
virtual ~CREMessageItemModel()
Definition: CREMessageItemModel.cpp:21
CREMessageItemModel::headerData
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Definition: CREMessageItemModel.cpp:210
CREMessageItemModel::myMessage
MessageFile * myMessage
Definition: CREMessageItemModel.h:52
CREMessageItemModel::setSelectedRule
void setSelectedRule(const QModelIndex &index)
Definition: CREMessageItemModel.cpp:32
CREMessageItemModel::moveUpDown
void moveUpDown(int row, bool up)
Definition: CREMessageItemModel.cpp:316
CREMessageItemModel::columnCount
virtual int columnCount(const QModelIndex &parent) const override
Definition: CREMessageItemModel.cpp:136
CREMessageItemModel::myRed
QSet< int > myRed
Definition: CREMessageItemModel.h:53
CREMessageItemModel::flags
virtual Qt::ItemFlags flags(const QModelIndex &index) const override
Definition: CREMessageItemModel.cpp:234
CREMessageItemModel::setMessage
void setMessage(MessageFile *message)
Definition: CREMessageItemModel.cpp:25
message
TIPS on SURVIVING Crossfire is populated with a wealth of different monsters These monsters can have varying immunities and attack types In some of them can be quite a bit smarter than others It will be important for new players to learn the abilities of different monsters and learn just how much it will take to kill them This section discusses how monsters can interact with players Most monsters in the game are out to mindlessly kill and destroy the players These monsters will help boost a player s after he kills them When fighting a large amount of monsters in a single attempt to find a narrower hallway so that you are not being attacked from all sides Charging into a room full of Beholders for instance would not be open the door and fight them one at a time For there are several maps designed for them Find these areas and clear them out All throughout these a player can find signs and books which they can read by stepping onto them and hitting A to apply the book sign These messages will help the player to learn the system One more always keep an eye on your food If your food drops to your character will soon so BE CAREFUL ! NPCs Non Player Character are special monsters which have intelligence Players may be able to interact with these monsters to help solve puzzles and find items of interest To speak with a monster you suspect to be a simply move to an adjacent square to them and push the double ie Enter your message
Definition: survival-guide.txt:34
disinfect.count
int count
Definition: disinfect.py:7
CREMessageItemModel::removeRows
virtual bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
Definition: CREMessageItemModel.cpp:297
autojail.value
value
Definition: autojail.py:6
CREMessageItemModel::parent
virtual QModelIndex parent(const QModelIndex &index) const override
Definition: CREMessageItemModel.cpp:150
MessageFile
Definition: MessageFile.h:68
CREMessageItemModel::insertRows
virtual bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
Definition: CREMessageItemModel.cpp:280
CREMessageItemModel::setData
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Definition: CREMessageItemModel.cpp:241
CREMessageItemModel::myBlue
QSet< int > myBlue
Definition: CREMessageItemModel.h:53
CREMessageItemModel::duplicateRow
void duplicateRow(int row)
Definition: CREMessageItemModel.cpp:333
CREMessageItemModel::data
virtual QVariant data(const QModelIndex &index, int role) const override
Definition: CREMessageItemModel.cpp:171
CREMessageItemModel::rowCount
virtual int rowCount(const QModelIndex &parent) const override
Definition: CREMessageItemModel.cpp:155
CREMessageItemModel::index
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const override
Definition: CREMessageItemModel.cpp:143