Crossfire Server, Trunk
ArtifactListWrapper.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 ARTIFACT_LIST_WRAPPER_H
14 #define ARTIFACT_LIST_WRAPPER_H
15 
16 #include <QObject>
17 #include <QStringList>
18 
19 #include "global.h"
20 #include "assets/AssetWrapper.h"
21 
22 class ResourcesManager;
23 
24 class ArtifactListWrapper : public AssetTWrapper<artifactlist> {
25 Q_OBJECT
26 
27 public:
29 
30  virtual QString displayName() const override {
32  return data ? data->name : tr("type %1").arg(myWrappedItem->type);
33  }
34 
35  virtual int childrenCount() const override;
36  virtual AssetWrapper *child(int) override;
37  virtual int childIndex(AssetWrapper *) override;
38 
39  virtual void wasModified(AssetWrapper *asset, ChangeType type, int extra) override;
40 
41  virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override;
42 
43 protected:
45 };
46 
47 #endif // ARTIFACT_LIST_WRAPPER_H
AssetTWrapper< artifactlist >::myWrappedItem
artifactlist * myWrappedItem
Definition: AssetWrapper.h:104
global.h
AssetWrapper.h
ResourcesManager
Definition: ResourcesManager.h:80
ArtifactListWrapper::displayName
virtual QString displayName() const override
Definition: ArtifactListWrapper.h:30
AssetWrapper::PossibleUse
PossibleUse
Definition: AssetWrapper.h:32
guildoracle.list
list
Definition: guildoracle.py:87
ArtifactListWrapper::myResourcesManager
ResourcesManager * myResourcesManager
Definition: ArtifactListWrapper.h:44
get_typedata
const typedata * get_typedata(int itemtype)
Definition: item.cpp:323
AssetWrapper
Definition: AssetWrapper.h:25
ArtifactListWrapper::childrenCount
virtual int childrenCount() const override
Definition: ArtifactListWrapper.cpp:22
ArtifactListWrapper::wasModified
virtual void wasModified(AssetWrapper *asset, ChangeType type, int extra) override
Definition: ArtifactListWrapper.cpp:51
AssetWrapper::ChangeType
ChangeType
Definition: AssetWrapper.h:33
navar-midane_time.data
data
Definition: navar-midane_time.py:11
artifactlist
Definition: artifact.h:24
ArtifactListWrapper::ArtifactListWrapper
ArtifactListWrapper(AssetWrapper *parent, artifactlist *list, ResourcesManager *resourcesManager)
Definition: ArtifactListWrapper.cpp:18
ArtifactListWrapper
Definition: ArtifactListWrapper.h:24
ArtifactListWrapper::child
virtual AssetWrapper * child(int) override
Definition: ArtifactListWrapper.cpp:26
ArtifactListWrapper::uses
virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override
Definition: ArtifactListWrapper.cpp:44
ArtifactListWrapper::childIndex
virtual int childIndex(AssetWrapper *) override
Definition: ArtifactListWrapper.cpp:33
artifactlist::type
uint8_t type
Definition: artifact.h:25
is_valid_types_gen.type
list type
Definition: is_valid_types_gen.py:25
AssetTWrapper
Definition: AssetWrapper.h:94