Crossfire Server, Trunk
ArchetypesWrapper.cpp
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 #include "ArchetypesWrapper.h"
14 #include "../ResourcesManager.h"
15 
16 #include "assets.h"
17 #include "AssetsManager.h"
18 
20  : AssetWrapper(parent), myResourcesManager(resourcesManager) {
21  getManager()->archetypes()->each([&] (archetype *arch) {
22  if (!arch->head) {
23  myArch.append(myResourcesManager->wrap(arch, this));
24  }
25  });
26  std::sort(myArch.begin(), myArch.end(), compareByDisplayName);
27  setProperty(tipProperty, tr("Display all archetypes."));
28 }
AssetWrapper::tipProperty
static const char * tipProperty
Definition: AssetWrapper.h:34
archininventory.arch
arch
DIALOGCHECK MINARGS 1 MAXARGS 1
Definition: archininventory.py:16
ArchetypesWrapper.h
AssetsManager.h
getManager
AssetsManager * getManager()
Definition: assets.cpp:305
AssetWrapper
Definition: AssetWrapper.h:25
AssetWrapper::compareByDisplayName
static bool compareByDisplayName(const AssetWrapper *left, const AssetWrapper *right)
Definition: AssetWrapper.h:66
ResourcesManager
Definition: ResourcesManager.h:80
AssetsManager::archetypes
Archetypes * archetypes()
Definition: AssetsManager.h:44
ArchetypesWrapper::ArchetypesWrapper
ArchetypesWrapper(AssetWrapper *parent, ResourcesManager *resourcesManager)
Definition: ArchetypesWrapper.cpp:19
archetype
Definition: object.h:474
ArchetypesWrapper::myArch
QVector< AssetWrapper * > myArch
Definition: ArchetypesWrapper.h:39
AssetsCollection::each
void each(std::function< void(T *)> op)
Definition: AssetsCollection.h:158
assets.h