Crossfire Server, Trunk
ArchetypesWrapper.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 ARCHETYPES_WRAPPER_H
14 #define ARCHETYPES_WRAPPER_H
15 
16 #include <QObject>
17 
18 #include "assets.h"
19 #include "AssetsManager.h"
20 #include "global.h"
22 
23 class ResourcesManager;
24 
25 class ArchetypesWrapper : public AssetsCollectionWrapper<archetype> {
26  Q_OBJECT
27 
28 public:
29  ArchetypesWrapper(AssetWrapper *parent, ResourcesManager *resources) : AssetsCollectionWrapper(parent, tr("Archetypes"), getManager()->archetypes(), resources, tr("Display all archetypes.")) {
30  myResources = resources;
31  }
32 
33  virtual PossibleUse uses(const AssetWrapper *, std::string &) const override {
34  return ChildrenMayUse;
35  }
36 
37  virtual void fillMenu(QMenu *menu) override;
38 
39 protected:
40  void addArchetype();
41 
43 };
44 
45 #endif // ARCHETYPE_WRAPPER_H
ArchetypesWrapper::fillMenu
virtual void fillMenu(QMenu *menu) override
Definition: ArchetypesWrapper.cpp:18
global.h
ResourcesManager
Definition: ResourcesManager.h:80
AssetsManager.h
AssetWrapper::PossibleUse
PossibleUse
Definition: AssetWrapper.h:32
getManager
AssetsManager * getManager()
Definition: assets.cpp:305
AssetWrapper::ChildrenMayUse
@ ChildrenMayUse
Definition: AssetWrapper.h:32
AssetWrapper
Definition: AssetWrapper.h:25
ArchetypesWrapper::ArchetypesWrapper
ArchetypesWrapper(AssetWrapper *parent, ResourcesManager *resources)
Definition: ArchetypesWrapper.h:29
ArchetypesWrapper
Definition: ArchetypesWrapper.h:25
AssetsCollectionWrapper.h
assets.h
ArchetypesWrapper::uses
virtual PossibleUse uses(const AssetWrapper *, std::string &) const override
Definition: ArchetypesWrapper.h:33
AssetsCollectionWrapper
Definition: AssetsCollectionWrapper.h:21
ArchetypesWrapper::addArchetype
void addArchetype()
Definition: ArchetypesWrapper.cpp:22
ArchetypesWrapper::myResources
ResourcesManager * myResources
Definition: ArchetypesWrapper.h:42