Crossfire Server, Trunk
ArtifactWrapper Class Reference

#include <ArtifactWrapper.h>

+ Inheritance diagram for ArtifactWrapper:
+ Collaboration diagram for ArtifactWrapper:

Public Member Functions

QStringList allowed () const
 
 ArtifactWrapper (AssetWrapper *parent, artifact *art, ResourcesManager *resourcesManager)
 
int chance () const
 
int difficulty () const
 
virtual QIcon displayIcon () const override
 
virtual QString displayName () const override
 
QObject * item ()
 
QString name () const
 
void setChance (int chance)
 
void setSpecificItem (const object *item)
 
virtual PossibleUse uses (const AssetWrapper *asset, std::string &) const override
 
- Public Member Functions inherited from AssetTWrapper< artifact >
 AssetTWrapper (AssetWrapper *parent, const QString &panelName, artifact *wrappedItem)
 
artifactwrappedItem () const
 
- Public Member Functions inherited from AssetWrapper
 AssetWrapper (AssetWrapper *parent, const QString &panelName="empty")
 
virtual bool canDrag () const
 
virtual bool canDrop (const QMimeData *, int) const
 
virtual AssetWrapperchild (int)
 
virtual int childIndex (AssetWrapper *)
 
virtual int childrenCount () const
 
virtual QString displayPanelName () const
 
AssetWrapperdisplayParent () const
 
virtual void drag (QMimeData *) const
 
virtual void drop (const QMimeData *, int)
 
virtual void fillMenu (QMenu *)
 
void markModified (ChangeType change, int extra=0)
 
AssetWrapperself ()
 
void setDisplayParent (AssetWrapper *parent)
 
virtual ~AssetWrapper () override
 

Protected Attributes

ResourcesManagermyResourcesManager
 
const objectmySpecificItem
 
- Protected Attributes inherited from AssetTWrapper< artifact >
artifactmyWrappedItem
 
- Protected Attributes inherited from AssetWrapper
QString myPanelName
 
AssetWrappermyParent
 

Properties

QStringList allowed
 
int chance
 
int difficulty
 
QObject item
 
QString name
 
- Properties inherited from AssetWrapper
QString displayName
 
AssetWrapper self
 

Additional Inherited Members

- Public Types inherited from AssetWrapper
enum  ChangeType {
  AssetUpdated, BeforeChildAdd, AfterChildAdd, BeforeChildRemove,
  AfterChildRemove, BeforeLayoutChange, AfterLayoutChange
}
 
enum  PossibleUse { Uses, ChildrenMayUse, DoesntUse }
 
- Public Slots inherited from AssetWrapper
virtual void removeChild (AssetWrapper *)
 
- Signals inherited from AssetWrapper
void dataModified (AssetWrapper *asset, AssetWrapper::ChangeType type, int extra)
 
void modified ()
 
- Static Public Member Functions inherited from AssetWrapper
static bool compareByDisplayName (const AssetWrapper *left, const AssetWrapper *right)
 
- Static Public Attributes inherited from AssetWrapper
static const char * tipProperty = "_cre_internal"
 
- Protected Member Functions inherited from AssetWrapper
virtual void wasModified (AssetWrapper *asset, ChangeType type, int extra)
 

Detailed Description

Definition at line 24 of file ArtifactWrapper.h.

Constructor & Destructor Documentation

◆ ArtifactWrapper()

ArtifactWrapper::ArtifactWrapper ( AssetWrapper parent,
artifact art,
ResourcesManager resourcesManager 
)

Definition at line 19 of file ArtifactWrapper.cpp.

Member Function Documentation

◆ allowed()

QStringList ArtifactWrapper::allowed ( ) const

◆ chance()

int ArtifactWrapper::chance ( ) const

◆ difficulty()

int ArtifactWrapper::difficulty ( ) const

◆ displayIcon()

QIcon ArtifactWrapper::displayIcon ( ) const
overridevirtual

Reimplemented from AssetWrapper.

Definition at line 48 of file ArtifactWrapper.cpp.

References artifact_get_face(), CREPixmap::getIcon(), and AssetTWrapper< artifact >::myWrappedItem.

+ Here is the call graph for this function:

◆ displayName()

QString ArtifactWrapper::displayName ( ) const
overridevirtual

◆ item()

QObject* ArtifactWrapper::item ( )

◆ name()

QString ArtifactWrapper::name ( ) const

◆ setChance()

void ArtifactWrapper::setChance ( int  chance)

Definition at line 64 of file ArtifactWrapper.cpp.

References AssetWrapper::AssetUpdated, chance, artifact::chance, AssetWrapper::markModified(), and AssetTWrapper< artifact >::myWrappedItem.

+ Here is the call graph for this function:

◆ setSpecificItem()

void ArtifactWrapper::setSpecificItem ( const object item)
inline

Definition at line 41 of file ArtifactWrapper.h.

References item, and mySpecificItem.

◆ uses()

AssetWrapper::PossibleUse ArtifactWrapper::uses ( const AssetWrapper asset,
std::string &   
) const
overridevirtual

Field Documentation

◆ myResourcesManager

ResourcesManager* ArtifactWrapper::myResourcesManager
protected

Definition at line 51 of file ArtifactWrapper.h.

◆ mySpecificItem

const object* ArtifactWrapper::mySpecificItem
protected

Definition at line 52 of file ArtifactWrapper.h.

Referenced by displayName(), and setSpecificItem().

Property Documentation

◆ allowed

QStringList ArtifactWrapper::allowed
read

Definition at line 31 of file ArtifactWrapper.h.

◆ chance

int ArtifactWrapper::chance
readwrite

Definition at line 29 of file ArtifactWrapper.h.

Referenced by setChance().

◆ difficulty

int ArtifactWrapper::difficulty
read

Definition at line 30 of file ArtifactWrapper.h.

◆ item

QObject * ArtifactWrapper::item
read

Definition at line 28 of file ArtifactWrapper.h.

Referenced by setSpecificItem().

◆ name

QString ArtifactWrapper::name
read

Definition at line 27 of file ArtifactWrapper.h.

Referenced by displayName().


The documentation for this class was generated from the following files: