Crossfire Server, Trunk
FacesWrapper.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 FACES_WRAPPER_H
14 #define FACES_WRAPPER_H
15 
16 #include "assets.h"
17 #include "AssetsManager.h"
19 
20 class FacesWrapper : public AssetsCollectionWrapper<Face> {
21  Q_OBJECT
22 public:
23  FacesWrapper(AssetWrapper *parent, ResourcesManager *resources) : AssetsCollectionWrapper<Face>(parent, tr("Faces"), getManager()->faces(), resources, tr("Display all faces.")) {
24  }
25 
26  virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override {
27  if (dynamic_cast<const FaceWrapper *>(asset)) {
28  return ChildrenMayUse;
29  }
30  return DoesntUse;
31  }
32 };
33 
34 #endif /* FACES_WRAPPER_H */
Face
Definition: face.h:14
ResourcesManager
Definition: ResourcesManager.h:80
AssetsManager.h
AssetWrapper::PossibleUse
PossibleUse
Definition: AssetWrapper.h:32
getManager
AssetsManager * getManager()
Definition: assets.cpp:305
FacesWrapper
Definition: FacesWrapper.h:20
AssetWrapper::ChildrenMayUse
@ ChildrenMayUse
Definition: AssetWrapper.h:32
FacesWrapper::FacesWrapper
FacesWrapper(AssetWrapper *parent, ResourcesManager *resources)
Definition: FacesWrapper.h:23
FaceWrapper
Definition: FaceWrapper.h:24
AssetWrapper
Definition: AssetWrapper.h:25
FacesWrapper::uses
virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override
Definition: FacesWrapper.h:26
AssetsCollectionWrapper.h
assets.h
dragon_attune.faces
dictionary faces
Definition: dragon_attune.py:31
AssetWrapper::DoesntUse
@ DoesntUse
Definition: AssetWrapper.h:32
AssetsCollectionWrapper
Definition: AssetsCollectionWrapper.h:21