Crossfire Server, Trunk
TreasureListWrapper Class Reference

#include <TreasureListWrapper.h>

+ Inheritance diagram for TreasureListWrapper:
+ Collaboration diagram for TreasureListWrapper:

Public Member Functions

virtual bool canDrag () const override
 
virtual bool canDrop (const QMimeData *data, int row) const override
 
virtual AssetWrapperchild (int child) override
 
virtual int childIndex (AssetWrapper *child) override
 
virtual int childrenCount () const override
 
virtual QIcon displayIcon () const override
 
virtual QString displayName () const override
 
virtual void drag (QMimeData *data) const override
 
virtual void drop (const QMimeData *data, int row) override
 
void fixTotalChance ()
 
bool isSingleItem () const
 
int itemCount () const
 
virtual void removeChild (AssetWrapper *child) override
 
void setSingleItem (bool isSingle)
 
int totalChance () const
 
 TreasureListWrapper (AssetWrapper *parent, treasurelist *list, ResourcesManager *resources)
 
virtual PossibleUse uses (const AssetWrapper *, std::string &) const override
 
- Public Member Functions inherited from AssetTWrapper< treasurelist >
 AssetTWrapper (AssetWrapper *parent, const QString &panelName, treasurelist *wrappedItem)
 
treasurelistwrappedItem () const
 
- Public Member Functions inherited from AssetWrapper
 AssetWrapper (AssetWrapper *parent, const QString &panelName="empty")
 
virtual QString displayPanelName () const
 
AssetWrapperdisplayParent () const
 
virtual void fillMenu (QMenu *)
 
void markModified (ChangeType change, int extra=0)
 
AssetWrapperself ()
 
void setDisplayParent (AssetWrapper *parent)
 
virtual ~AssetWrapper () override
 

Protected Member Functions

virtual void wasModified (AssetWrapper *asset, ChangeType type, int extra) override
 

Protected Attributes

ResourcesManagermyResources
 
- Protected Attributes inherited from AssetTWrapper< treasurelist >
treasurelistmyWrappedItem
 
- Protected Attributes inherited from AssetWrapper
QString myPanelName
 
AssetWrappermyParent
 

Properties

bool isSingleItem
 
int itemCount
 
QString name
 
int totalChance
 
- 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
- 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"
 

Detailed Description

Definition at line 27 of file TreasureListWrapper.h.

Constructor & Destructor Documentation

◆ TreasureListWrapper()

TreasureListWrapper::TreasureListWrapper ( AssetWrapper parent,
treasurelist list,
ResourcesManager resources 
)

Definition at line 22 of file TreasureListWrapper.cpp.

Member Function Documentation

◆ canDrag()

virtual bool TreasureListWrapper::canDrag ( ) const
inlineoverridevirtual

Reimplemented from AssetWrapper.

Definition at line 46 of file TreasureListWrapper.h.

◆ canDrop()

bool TreasureListWrapper::canDrop ( const QMimeData *  data,
int  row 
) const
overridevirtual

Reimplemented from AssetWrapper.

Definition at line 103 of file TreasureListWrapper.cpp.

References MimeUtils::Archetype, navar-midane_time::data, and MimeUtils::TreasureList.

◆ child()

AssetWrapper * TreasureListWrapper::child ( int  child)
overridevirtual

Reimplemented from AssetWrapper.

Definition at line 41 of file TreasureListWrapper.cpp.

References treasurelist::items, myResources, AssetTWrapper< treasurelist >::myWrappedItem, and ResourcesManager::wrap().

Referenced by childIndex(), and removeChild().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ childIndex()

int TreasureListWrapper::childIndex ( AssetWrapper child)
overridevirtual

Reimplemented from AssetWrapper.

Definition at line 50 of file TreasureListWrapper.cpp.

References child(), npc_dialog::index, treasurelist::items, myResources, AssetTWrapper< treasurelist >::myWrappedItem, and ResourcesManager::wrap().

Referenced by removeChild(), and wasModified().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ childrenCount()

int TreasureListWrapper::childrenCount ( ) const
overridevirtual

Reimplemented from AssetWrapper.

Definition at line 37 of file TreasureListWrapper.cpp.

References itemCount.

Referenced by drop().

+ Here is the caller graph for this function:

◆ displayIcon()

virtual QIcon TreasureListWrapper::displayIcon ( ) const
inlineoverridevirtual

Reimplemented from AssetWrapper.

Definition at line 39 of file TreasureListWrapper.h.

References CREPixmap::getTreasureIcon(), CREPixmap::getTreasureOneIcon(), AssetTWrapper< treasurelist >::myWrappedItem, and treasurelist::total_chance.

+ Here is the call graph for this function:

◆ displayName()

virtual QString TreasureListWrapper::displayName ( ) const
inlineoverridevirtual

◆ drag()

void TreasureListWrapper::drag ( QMimeData *  data) const
overridevirtual

◆ drop()

◆ fixTotalChance()

void TreasureListWrapper::fixTotalChance ( )

Definition at line 75 of file TreasureListWrapper.cpp.

References treasurelist::items, AssetTWrapper< treasurelist >::myWrappedItem, and treasurelist::total_chance.

Referenced by drop(), removeChild(), setSingleItem(), and wasModified().

+ Here is the caller graph for this function:

◆ isSingleItem()

bool TreasureListWrapper::isSingleItem ( ) const
inline

◆ itemCount()

int TreasureListWrapper::itemCount ( ) const

◆ removeChild()

◆ setSingleItem()

void TreasureListWrapper::setSingleItem ( bool  isSingle)

◆ totalChance()

int TreasureListWrapper::totalChance ( ) const
inline

◆ uses()

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

Reimplemented from AssetWrapper.

Definition at line 157 of file TreasureListWrapper.cpp.

References AssetWrapper::ChildrenMayUse, and AssetWrapper::DoesntUse.

◆ wasModified()

void TreasureListWrapper::wasModified ( AssetWrapper asset,
ChangeType  type,
int  extra 
)
overrideprotectedvirtual

Field Documentation

◆ myResources

ResourcesManager* TreasureListWrapper::myResources
protected

Definition at line 60 of file TreasureListWrapper.h.

Referenced by child(), childIndex(), removeChild(), and wasModified().

Property Documentation

◆ isSingleItem

bool TreasureListWrapper::isSingleItem
readwrite

Definition at line 33 of file TreasureListWrapper.h.

Referenced by setSingleItem().

◆ itemCount

int TreasureListWrapper::itemCount
read

Definition at line 32 of file TreasureListWrapper.h.

Referenced by childrenCount().

◆ name

QString TreasureListWrapper::name
read

Definition at line 30 of file TreasureListWrapper.h.

◆ totalChance

int TreasureListWrapper::totalChance
read

Definition at line 31 of file TreasureListWrapper.h.


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