Crossfire Server, Trunk
RegionsWrapper.cpp
Go to the documentation of this file.
1 #include "RegionsWrapper.h"
2 #include "../ResourcesManager.h"
3 
5  for (region* reg = first_region; reg; reg = reg->next) {
6  myRegions.push_front(resources->wrap(reg, this));
7  }
8  qSort(myRegions.begin(), myRegions.end(), compareByDisplayName);
9  setProperty(tipProperty, tr("Display all maps and regions."));
10 }
11 
12 AssetWrapper::PossibleUse RegionsWrapper::uses(const AssetWrapper *asset, std::string &) const {
13  return (dynamic_cast<const QuestWrapper *>(asset)
14  || dynamic_cast<const FaceWrapper *>(asset)
15  || dynamic_cast<const AnimationWrapper *>(asset)
17 }
ResourcesManager
Definition: ResourcesManager.h:67
AnimationWrapper
Definition: AnimationWrapper.h:15
QuestWrapper
Definition: QuestWrapper.h:15
AssetWrapper::PossibleUse
PossibleUse
Definition: AssetWrapper.h:14
ResourcesManager::wrap
ArchetypeWrapper * wrap(archt *arch, AssetWrapper *parent)
Definition: ResourcesManager.h:112
AssetWrapper::tipProperty
static const char * tipProperty
Definition: AssetWrapper.h:16
RegionsWrapper::uses
virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override
Definition: RegionsWrapper.cpp:12
AssetWrapper::ChildrenMayUse
@ ChildrenMayUse
Definition: AssetWrapper.h:14
regiondef::next
struct regiondef * next
Definition: map.h:276
FaceWrapper
Definition: FaceWrapper.h:15
AssetWrapper
Definition: AssetWrapper.h:11
RegionsWrapper::RegionsWrapper
RegionsWrapper(AssetWrapper *parent, ResourcesManager *resources)
Definition: RegionsWrapper.cpp:4
RegionsWrapper.h
RegionsWrapper::myRegions
QVector< AssetWrapper * > myRegions
Definition: RegionsWrapper.h:20
AssetWrapper::DoesntUse
@ DoesntUse
Definition: AssetWrapper.h:14
AssetWrapper::compareByDisplayName
static bool compareByDisplayName(const AssetWrapper *left, const AssetWrapper *right)
Definition: AssetWrapper.h:47
first_region
EXTERN region * first_region
Definition: global.h:117
regiondef
Definition: map.h:275