Crossfire Server, Trunk
QuestsWrapper.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 QUESTS_WRAPPER_H
14 #define QUESTS_WRAPPER_H
15 
16 #include "assets.h"
17 #include "AssetsManager.h"
19 
23 class QuestsWrapper : public AssetsCollectionWrapper<quest_definition> {
24 public:
25  QuestsWrapper(AssetWrapper *parent, ResourcesManager *resources) : AssetsCollectionWrapper(parent, "Quests", getManager()->quests(), resources, tr("Display all quests.")) {
26  myResources = resources;
27  }
28 
29  virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override {
30  if (dynamic_cast<const FaceWrapper *>(asset)) {
31  return ChildrenMayUse;
32  }
33  return DoesntUse;
34  }
35 
36  virtual void fillMenu(QMenu *menu) override;
37 
38 protected:
44  void addQuest();
45 };
46 
47 #endif /* QUESTS_WRAPPER_H */
QuestsWrapper::uses
virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override
Definition: QuestsWrapper.h:29
ResourcesManager
Definition: ResourcesManager.h:80
AssetsManager.h
QuestsWrapper::addQuest
void addQuest()
Definition: QuestsWrapper.cpp:23
AssetWrapper::PossibleUse
PossibleUse
Definition: AssetWrapper.h:31
getManager
AssetsManager * getManager()
Definition: assets.cpp:309
AssetWrapper::ChildrenMayUse
@ ChildrenMayUse
Definition: AssetWrapper.h:31
FaceWrapper
Definition: FaceWrapper.h:24
AssetWrapper
Definition: AssetWrapper.h:25
QuestsWrapper::myResources
ResourcesManager * myResources
Definition: QuestsWrapper.h:39
QuestsWrapper::QuestsWrapper
QuestsWrapper(AssetWrapper *parent, ResourcesManager *resources)
Definition: QuestsWrapper.h:25
QuestsWrapper
Definition: QuestsWrapper.h:23
AssetsCollectionWrapper.h
assets.h
AssetWrapper::DoesntUse
@ DoesntUse
Definition: AssetWrapper.h:31
AssetsCollectionWrapper
Definition: AssetsCollectionWrapper.h:21
quests
static struct_quest ** quests
Definition: mapper.cpp:922
QuestsWrapper::fillMenu
virtual void fillMenu(QMenu *menu) override
Definition: QuestsWrapper.cpp:19