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 "global.h"
19 #include "assets/AssetWrapper.h"
20 
21 class ResourcesManager;
22 
24  Q_OBJECT
25 
26 public:
27  ArchetypesWrapper(AssetWrapper *parent, ResourcesManager *resourcesManager);
28 
29  virtual QString displayName() const override { return "Archetypes"; }
30  virtual int childrenCount() const override { return myArch.size(); }
31  virtual AssetWrapper *child(int index) override { return myArch[index]; }
32  virtual int childIndex(AssetWrapper *child) override { return myArch.indexOf(child); }
33 
34  virtual PossibleUse uses(const AssetWrapper *, std::string &) const override {
35  return ChildrenMayUse;
36  }
37 
38 protected:
39  QVector<AssetWrapper *> myArch;
41 };
42 
43 #endif // ARCHETYPE_WRAPPER_H
global.h
AssetWrapper.h
ResourcesManager
Definition: ResourcesManager.h:80
ArchetypesWrapper::ArchetypesWrapper
ArchetypesWrapper(AssetWrapper *parent, ResourcesManager *resourcesManager)
Definition: ArchetypesWrapper.cpp:19
AssetWrapper::PossibleUse
PossibleUse
Definition: AssetWrapper.h:31
ArchetypesWrapper::childrenCount
virtual int childrenCount() const override
Definition: ArchetypesWrapper.h:30
AssetWrapper::ChildrenMayUse
@ ChildrenMayUse
Definition: AssetWrapper.h:31
ArchetypesWrapper::childIndex
virtual int childIndex(AssetWrapper *child) override
Definition: ArchetypesWrapper.h:32
ArchetypesWrapper::myResourcesManager
ResourcesManager * myResourcesManager
Definition: ArchetypesWrapper.h:40
ArchetypesWrapper::displayName
virtual QString displayName() const override
Definition: ArchetypesWrapper.h:29
AssetWrapper
Definition: AssetWrapper.h:25
ArchetypesWrapper
Definition: ArchetypesWrapper.h:23
ArchetypesWrapper::myArch
QVector< AssetWrapper * > myArch
Definition: ArchetypesWrapper.h:39
ArchetypesWrapper::child
virtual AssetWrapper * child(int index) override
Definition: ArchetypesWrapper.h:31
npc_dialog.index
int index
Definition: npc_dialog.py:102
ArchetypesWrapper::uses
virtual PossibleUse uses(const AssetWrapper *, std::string &) const override
Definition: ArchetypesWrapper.h:34