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 public:
22  RegionsWrapper(AssetWrapper *parent, ResourcesManager *resources);
23  virtual QString displayName() const { return "Regions and maps"; }
24 
25  virtual int childrenCount() const { return myRegions.size(); }
26  virtual AssetWrapper *child(int index) { return myRegions[index]; }
27  virtual int childIndex(AssetWrapper *child) { return myRegions.indexOf(child); }
28 
29  virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override;
30 
31 private:
32  QVector<AssetWrapper *> myRegions;
33 };
34 
35 #endif /* REGIONS_WRAPPER_H */
AssetWrapper.h
ResourcesManager
Definition: ResourcesManager.h:80
RegionsWrapper::child
virtual AssetWrapper * child(int index)
Definition: RegionsWrapper.h:26
AssetWrapper::PossibleUse
PossibleUse
Definition: AssetWrapper.h:31
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:25
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:23
RegionsWrapper::myRegions
QVector< AssetWrapper * > myRegions
Definition: RegionsWrapper.h:32
RegionsWrapper::childIndex
virtual int childIndex(AssetWrapper *child)
Definition: RegionsWrapper.h:27
npc_dialog.index
int index
Definition: npc_dialog.py:102