Crossfire Server, Trunk
FaceWrapper.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 "FaceWrapper.h"
14 #include "../ResourcesManager.h"
15 #include "../CREPixmap.h"
16 
17 FaceWrapper::FaceWrapper(AssetWrapper *parent, Face *face, ResourcesManager *resourcesManager)
18  : AssetTWrapper(parent, "Face", face), myResourcesManager(resourcesManager) {
19 }
20 
21 AssetWrapper::PossibleUse FaceWrapper::uses(const AssetWrapper *asset, std::string &hint) const {
22  auto face = dynamic_cast<const FaceWrapper *>(asset);
23  if (face) {
24  if (myWrappedItem->smoothface == face->myWrappedItem) {
25  hint = "as smoothed face";
26  return Uses;
27  }
28  }
29  return DoesntUse;
30 }
AssetTWrapper< Face >::myWrappedItem
Face * myWrappedItem
Definition: AssetWrapper.h:104
Face
Definition: face.h:14
Face::smoothface
Face * smoothface
Definition: face.h:18
ResourcesManager
Definition: ResourcesManager.h:80
FaceWrapper::FaceWrapper
FaceWrapper(AssetWrapper *parent, Face *face, ResourcesManager *resourcesManager)
Definition: FaceWrapper.cpp:17
AssetWrapper::PossibleUse
PossibleUse
Definition: AssetWrapper.h:32
FaceWrapper
Definition: FaceWrapper.h:24
AssetWrapper
Definition: AssetWrapper.h:25
FaceWrapper.h
AssetWrapper::Uses
@ Uses
Definition: AssetWrapper.h:32
AssetWrapper::DoesntUse
@ DoesntUse
Definition: AssetWrapper.h:32
FaceWrapper::uses
virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override
Definition: FaceWrapper.cpp:21
AssetTWrapper
Definition: AssetWrapper.h:94