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
19
ArchetypesWrapper::ArchetypesWrapper
(
AssetWrapper
*parent,
ResourcesManager
*resourcesManager)
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
}
ResourcesManager
Definition:
ResourcesManager.h:80
archininventory.arch
arch
DIALOGCHECK MINARGS 1 MAXARGS 1
Definition:
archininventory.py:16
AssetsManager.h
ArchetypesWrapper::ArchetypesWrapper
ArchetypesWrapper(AssetWrapper *parent, ResourcesManager *resourcesManager)
Definition:
ArchetypesWrapper.cpp:19
AssetWrapper::tipProperty
static const char * tipProperty
Definition:
AssetWrapper.h:34
getManager
AssetsManager * getManager()
Definition:
assets.cpp:305
ArchetypesWrapper.h
AssetWrapper
Definition:
AssetWrapper.h:25
archetype
Definition:
object.h:474
AssetsCollection::each
void each(std::function< void(T *)> op)
Definition:
AssetsCollection.h:158
ArchetypesWrapper::myArch
QVector< AssetWrapper * > myArch
Definition:
ArchetypesWrapper.h:39
AssetsManager::archetypes
Archetypes * archetypes()
Definition:
AssetsManager.h:44
assets.h
AssetWrapper::compareByDisplayName
static bool compareByDisplayName(const AssetWrapper *left, const AssetWrapper *right)
Definition:
AssetWrapper.h:66
crossfire-crossfire-server
utils
cre
archetypes
ArchetypesWrapper.cpp
Generated by
1.8.17