Crossfire Server, Trunk
AttackMessagesWrapper.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 ATTACKMESSAGESWRAPPER_H
14 #define ATTACKMESSAGESWRAPPER_H
15 
16 #include "../assets/AssetWrapper.h"
17 
19  Q_OBJECT
20 public:
21  SingleAttackWrapper(AssetWrapper *parent, uint8_t attackType, const std::string &name)
22  : AssetWrapper(parent, "AttackMessage"), myAttackType(attackType), myName(QString::fromStdString(name)) { }
23  virtual QString displayName() const { return myName; }
24 
25  uint8_t attackType() const { return myAttackType; }
26 
27 private:
28  uint8_t myAttackType;
29  QString myName;
30 };
31 
33  Q_OBJECT
34 public:
36 
37  virtual QString displayName() const { return tr("Attack messages"); }
38 
39  virtual int childrenCount() const { return myChildren.size(); }
40  virtual AssetWrapper *child(int index) { return myChildren[index]; }
41  virtual int childIndex(AssetWrapper *asset);
42 
43  std::vector<SingleAttackWrapper *> myChildren;
44 };
45 
46 #endif /* ATTACKMESSAGESWRAPPER_H */
AttackMessagesWrapper
Definition: AttackMessagesWrapper.h:32
AttackMessagesWrapper::displayName
virtual QString displayName() const
Definition: AttackMessagesWrapper.h:37
SingleAttackWrapper::myAttackType
uint8_t myAttackType
Definition: AttackMessagesWrapper.h:28
AttackMessagesWrapper::childIndex
virtual int childIndex(AssetWrapper *asset)
Definition: AttackMessagesWrapper.cpp:46
SingleAttackWrapper::myName
QString myName
Definition: AttackMessagesWrapper.h:29
AttackMessagesWrapper::child
virtual AssetWrapper * child(int index)
Definition: AttackMessagesWrapper.h:40
AttackMessagesWrapper::myChildren
std::vector< SingleAttackWrapper * > myChildren
Definition: AttackMessagesWrapper.h:43
AssetWrapper
Definition: AssetWrapper.h:25
SingleAttackWrapper
Definition: AttackMessagesWrapper.h:18
AttackMessagesWrapper::AttackMessagesWrapper
AttackMessagesWrapper(AssetWrapper *parent)
Definition: AttackMessagesWrapper.cpp:39
AttackMessagesWrapper::childrenCount
virtual int childrenCount() const
Definition: AttackMessagesWrapper.h:39
SingleAttackWrapper::attackType
uint8_t attackType() const
Definition: AttackMessagesWrapper.h:25
SingleAttackWrapper::SingleAttackWrapper
SingleAttackWrapper(AssetWrapper *parent, uint8_t attackType, const std::string &name)
Definition: AttackMessagesWrapper.h:21
npc_dialog.index
int index
Definition: npc_dialog.py:102
SingleAttackWrapper::displayName
virtual QString displayName() const
Definition: AttackMessagesWrapper.h:23
give.name
name
Definition: give.py:27