Crossfire Server, Trunk
RegionsWrapper.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 REGIONS_WRAPPER_H
14 #define REGIONS_WRAPPER_H
15 
16 #include "assets/AssetWrapper.h"
17 
18 class ResourcesManager;
19 
20 class RegionsWrapper : public AssetWrapper {
21  Q_OBJECT
22 public:
23  RegionsWrapper(AssetWrapper *parent, ResourcesManager *resources);
24  virtual QString displayName() const { return tr("Regions and maps"); }
25 
26  virtual int childrenCount() const { return myRegions.size(); }
27  virtual AssetWrapper *child(int index) { return myRegions[index]; }
28  virtual int childIndex(AssetWrapper *child) { return myRegions.indexOf(child); }
29 
30  virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override;
31 
32 private:
33  QVector<AssetWrapper *> myRegions;
34 };
35 
36 #endif /* REGIONS_WRAPPER_H */
AssetWrapper.h
ResourcesManager
Definition: ResourcesManager.h:80
RegionsWrapper::child
virtual AssetWrapper * child(int index)
Definition: RegionsWrapper.h:27
AssetWrapper::PossibleUse
PossibleUse
Definition: AssetWrapper.h:32
RegionsWrapper::uses
virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override
Definition: RegionsWrapper.cpp:26
RegionsWrapper
Definition: RegionsWrapper.h:20
RegionsWrapper::childrenCount
virtual int childrenCount() const
Definition: RegionsWrapper.h:26
AssetWrapper
Definition: AssetWrapper.h:25
RegionsWrapper::RegionsWrapper
RegionsWrapper(AssetWrapper *parent, ResourcesManager *resources)
Definition: RegionsWrapper.cpp:18
RegionsWrapper::displayName
virtual QString displayName() const
Definition: RegionsWrapper.h:24
RegionsWrapper::myRegions
QVector< AssetWrapper * > myRegions
Definition: RegionsWrapper.h:33
RegionsWrapper::childIndex
virtual int childIndex(AssetWrapper *child)
Definition: RegionsWrapper.h:28
npc_dialog.index
int index
Definition: npc_dialog.py:102