Crossfire Server, Trunk
FaceWrapper.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 FACE_WRAPPER_H
14 #define FACE_WRAPPER_H
15 
16 #include <QObject>
17 
18 #include "global.h"
19 #include "assets/AssetWrapper.h"
20 #include "CREPixmap.h"
21 
22 class ResourcesManager;
23 
24 class FaceWrapper : public AssetTWrapper<Face> {
25  Q_OBJECT
26 
27  Q_PROPERTY(QString name READ name)
28 
29 public:
30  FaceWrapper(AssetWrapper *parent, Face* face, ResourcesManager *resourcesManager);
31 
32  virtual QString displayName() const override { return myWrappedItem->name; }
33  virtual QIcon displayIcon() const override { return CREPixmap::getIcon(myWrappedItem); }
34 
35  virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override;
36 
37  QString name() const { return myWrappedItem->name; }
38 
39 protected:
41 };
42 
43 #endif // FACE_WRAPPER_H
Face::name
sstring name
Definition: face.h:19
AssetTWrapper< Face >::myWrappedItem
Face * myWrappedItem
Definition: AssetWrapper.h:103
Face
Definition: face.h:14
FaceWrapper::name
QString name
Definition: FaceWrapper.h:27
global.h
AssetWrapper.h
ResourcesManager
Definition: ResourcesManager.h:80
FaceWrapper::FaceWrapper
FaceWrapper(AssetWrapper *parent, Face *face, ResourcesManager *resourcesManager)
Definition: FaceWrapper.cpp:17
FaceWrapper::name
QString name() const
Definition: FaceWrapper.h:37
AssetWrapper::PossibleUse
PossibleUse
Definition: AssetWrapper.h:31
CREPixmap::getIcon
static QIcon getIcon(uint16_t faceNumber)
Definition: CREPixmap.cpp:65
FaceWrapper::displayIcon
virtual QIcon displayIcon() const override
Definition: FaceWrapper.h:33
FaceWrapper
Definition: FaceWrapper.h:24
AssetWrapper
Definition: AssetWrapper.h:25
FaceWrapper::myResourcesManager
ResourcesManager * myResourcesManager
Definition: FaceWrapper.h:40
FaceWrapper::displayName
virtual QString displayName() const override
Definition: FaceWrapper.h:32
CREPixmap.h
FaceWrapper::uses
virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override
Definition: FaceWrapper.cpp:21
AssetTWrapper
Definition: AssetWrapper.h:93