Crossfire Server, Trunk
TreasureWrapper Class Reference

#include <TreasureWrapper.h>

+ Inheritance diagram for TreasureWrapper:
+ Collaboration diagram for TreasureWrapper:

Public Slots

void swapYesNo ()
 
- Public Slots inherited from AssetWrapper

Public Member Functions

const archetypearch () const
 
virtual bool canDrop (const QMimeData *data, int row) const override
 
uint8_t chance () const
 
virtual AssetWrapperchild (int child) override
 
virtual int childIndex (AssetWrapper *child) override
 
virtual int childrenCount () const override
 
virtual void displayFillPanel (QWidget *panel) override
 
virtual QIcon displayIcon () const override
 
virtual QString displayName () const override
 
virtual void drop (const QMimeData *data, int row) override
 
virtual void fillMenu (QMenu *menu) override
 
const treasurelistlist () const
 
uint8_t magic () const
 
uint16_t nrof () const
 
virtual void removeChild (AssetWrapper *child) override
 
void setArch (const archetype *arch)
 
void setChance (uint8_t chance)
 
void setList (const treasurelist *list)
 
void setMagic (uint8_t magic)
 
void setNrof (uint16_t nrof)
 
 TreasureWrapper (AssetWrapper *parent, treasure *tr, ResourcesManager *resources)
 
virtual ~TreasureWrapper ()
 
- Public Member Functions inherited from AssetWithArtifacts< treasure >
 AssetWithArtifacts (AssetWrapper *parent, const QString &panelName, treasure *item, ResourcesManager *resources)
 
virtual int childrenCount () const override
 
virtual ~AssetWithArtifacts ()
 
- Public Member Functions inherited from AssetTWrapper< treasure >
 AssetTWrapper (AssetWrapper *parent, const QString &panelName, treasure *wrappedItem)
 
treasurewrappedItem () const
 
- Public Member Functions inherited from AssetWrapper
 AssetWrapper (AssetWrapper *parent, const QString &panelName="empty")
 
virtual bool canDrag () const
 
virtual QString displayPanelName () const
 
AssetWrapperdisplayParent () const
 
virtual void drag (QMimeData *) const
 
void markModified (ChangeType change, int extra=0)
 
void setDisplayParent (AssetWrapper *parent)
 
virtual PossibleUse uses (const AssetWrapper *, std::string &) const
 
virtual ~AssetWrapper () override
 

Protected Member Functions

void addChild (treasurelist *tl, archetype *arch)
 
void doAddChild (TreasureYesNo **my, treasure **ti, bool isYes, int index, treasurelist *tl, archetype *arch)
 
void doRemoveChild (TreasureYesNo **tr, treasure **ti, int index)
 
- Protected Member Functions inherited from AssetWithArtifacts< treasure >
void setSpecificItem (const object *item, bool notify)
 
void updateArtifacts (bool notify)
 
- Protected Member Functions inherited from AssetWrapper
virtual void wasModified (AssetWrapper *asset, ChangeType type, int extra)
 

Protected Attributes

TreasureYesNomyNextNo
 
TreasureYesNomyNextYes
 
- Protected Attributes inherited from AssetWithArtifacts< treasure >
std::vector< ArtifactWrapper * > myArtifacts
 
ResourcesManagermyResources
 
const objectmySpecificItem
 
- Protected Attributes inherited from AssetTWrapper< treasure >
treasuremyWrappedItem
 
- Protected Attributes inherited from AssetWrapper
QString myPanelName
 
AssetWrappermyParent
 

Properties

const archetype arch
 
quint8 chance
 
const treasurelist list
 
quint8 magic
 
quint16 nrof
 

Additional Inherited Members

- Public Types inherited from AssetWrapper
enum  ChangeType {
  AssetUpdated, BeforeChildAdd, AfterChildAdd, BeforeChildRemove,
  AfterChildRemove, BeforeLayoutChange, AfterLayoutChange
}
 
enum  PossibleUse { Uses, ChildrenMayUse, DoesntUse }
 
- 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 20 of file TreasureWrapper.h.

Constructor & Destructor Documentation

◆ TreasureWrapper()

TreasureWrapper::TreasureWrapper ( AssetWrapper parent,
treasure tr,
ResourcesManager resources 
)

◆ ~TreasureWrapper()

TreasureWrapper::~TreasureWrapper ( )
virtual

Definition at line 28 of file TreasureWrapper.cpp.

Member Function Documentation

◆ addChild()

void TreasureWrapper::addChild ( treasurelist tl,
archetype arch 
)
protected

Definition at line 162 of file TreasureWrapper.cpp.

References arch, doAddChild(), myNextNo, myNextYes, AssetTWrapper< treasure >::myWrappedItem, treasurestruct::next_no, and treasurestruct::next_yes.

Referenced by drop().

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

◆ arch()

const archetype* TreasureWrapper::arch ( ) const

◆ canDrop()

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

Reimplemented from AssetWrapper.

Definition at line 172 of file TreasureWrapper.cpp.

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

◆ chance()

uint8_t TreasureWrapper::chance ( ) const

◆ child()

AssetWrapper * TreasureWrapper::child ( int  child)
overridevirtual

Reimplemented from AssetWithArtifacts< treasure >.

Definition at line 92 of file TreasureWrapper.cpp.

References AssetWithArtifacts< T >::child(), myNextNo, and myNextYes.

Referenced by TreasureYesNo::child(), childIndex(), TreasureYesNo::childIndex(), and removeChild().

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

◆ childIndex()

int TreasureWrapper::childIndex ( AssetWrapper child)
overridevirtual

Reimplemented from AssetWithArtifacts< treasure >.

Definition at line 108 of file TreasureWrapper.cpp.

References c, child(), AssetWithArtifacts< T >::childIndex(), npc_dialog::index, myNextNo, and myNextYes.

+ Here is the call graph for this function:

◆ childrenCount()

int TreasureWrapper::childrenCount ( ) const
overridevirtual

Reimplemented from AssetWrapper.

Definition at line 81 of file TreasureWrapper.cpp.

References AssetWithArtifacts< T >::childrenCount(), disinfect::count, AssetTWrapper< treasure >::myWrappedItem, treasurestruct::next_no, and treasurestruct::next_yes.

+ Here is the call graph for this function:

◆ displayFillPanel()

void TreasureWrapper::displayFillPanel ( QWidget *  panel)
overridevirtual

Reimplemented from AssetTWrapper< treasure >.

Definition at line 76 of file TreasureWrapper.cpp.

References AssetWrapperPanel::setItem().

+ Here is the call graph for this function:

◆ displayIcon()

QIcon TreasureWrapper::displayIcon ( ) const
overridevirtual

◆ displayName()

QString TreasureWrapper::displayName ( ) const
overridevirtual

◆ doAddChild()

void TreasureWrapper::doAddChild ( TreasureYesNo **  my,
treasure **  ti,
bool  isYes,
int  index,
treasurelist tl,
archetype arch 
)
protected

Definition at line 151 of file TreasureWrapper.cpp.

References add_string(), AssetWrapper::AfterChildAdd, arch, AssetWrapper::BeforeChildAdd, get_empty_treasure(), npc_dialog::index, AssetWrapper::markModified(), AssetWithArtifacts< treasure >::myResources, treasureliststruct::name, and archt::name.

Referenced by addChild().

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

◆ doRemoveChild()

void TreasureWrapper::doRemoveChild ( TreasureYesNo **  tr,
treasure **  ti,
int  index 
)
protected

Definition at line 130 of file TreasureWrapper.cpp.

References AssetWrapper::AfterChildRemove, AssetWrapper::BeforeChildRemove, npc_dialog::index, AssetWrapper::markModified(), AssetWithArtifacts< treasure >::myResources, ResourcesManager::remove(), and treasure_free().

Referenced by removeChild().

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

◆ drop()

void TreasureWrapper::drop ( const QMimeData *  data,
int  row 
)
overridevirtual

Reimplemented from AssetWrapper.

Definition at line 179 of file TreasureWrapper.cpp.

References addChild(), arch, MimeUtils::Archetype, navar-midane_time::data, MimeUtils::extract(), getManager(), list, lists, and MimeUtils::TreasureList.

+ Here is the call graph for this function:

◆ fillMenu()

void TreasureWrapper::fillMenu ( QMenu *  menu)
overridevirtual

Reimplemented from AssetWrapper.

Definition at line 255 of file TreasureWrapper.cpp.

References myNextNo, myNextYes, AssetWrapper::myParent, AssetWrapper::removeChild(), and swapYesNo().

+ Here is the call graph for this function:

◆ list()

const treasurelist* TreasureWrapper::list ( ) const

◆ magic()

uint8_t TreasureWrapper::magic ( ) const

◆ nrof()

uint16_t TreasureWrapper::nrof ( ) const

◆ removeChild()

void TreasureWrapper::removeChild ( AssetWrapper child)
overridevirtual

Reimplemented from AssetWrapper.

Definition at line 141 of file TreasureWrapper.cpp.

References child(), doRemoveChild(), myNextNo, myNextYes, AssetTWrapper< treasure >::myWrappedItem, treasurestruct::next_no, and treasurestruct::next_yes.

+ Here is the call graph for this function:

◆ setArch()

◆ setChance()

void TreasureWrapper::setChance ( uint8_t  chance)

Definition at line 195 of file TreasureWrapper.cpp.

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

+ Here is the call graph for this function:

◆ setList()

◆ setMagic()

void TreasureWrapper::setMagic ( uint8_t  magic)

Definition at line 206 of file TreasureWrapper.cpp.

References AssetWrapper::AssetUpdated, magic, treasurestruct::magic, AssetWrapper::markModified(), and AssetTWrapper< treasure >::myWrappedItem.

+ Here is the call graph for this function:

◆ setNrof()

void TreasureWrapper::setNrof ( uint16_t  nrof)

Definition at line 217 of file TreasureWrapper.cpp.

References AssetWrapper::AssetUpdated, AssetWrapper::markModified(), AssetTWrapper< treasure >::myWrappedItem, nrof, and treasurestruct::nrof.

+ Here is the call graph for this function:

◆ swapYesNo

void TreasureWrapper::swapYesNo ( )
slot

Field Documentation

◆ myNextNo

TreasureYesNo* TreasureWrapper::myNextNo
protected

◆ myNextYes

TreasureYesNo* TreasureWrapper::myNextYes
protected

Property Documentation

◆ arch

const archetype * TreasureWrapper::arch
readwrite

Definition at line 27 of file TreasureWrapper.h.

Referenced by addChild(), doAddChild(), drop(), and setArch().

◆ chance

uint8_t TreasureWrapper::chance
readwrite

Definition at line 23 of file TreasureWrapper.h.

Referenced by setChance().

◆ list

const treasurelist * TreasureWrapper::list
readwrite

Definition at line 26 of file TreasureWrapper.h.

Referenced by drop(), and setList().

◆ magic

uint8_t TreasureWrapper::magic
readwrite

Definition at line 24 of file TreasureWrapper.h.

Referenced by setMagic().

◆ nrof

uint16_t TreasureWrapper::nrof
readwrite

Definition at line 25 of file TreasureWrapper.h.

Referenced by setNrof().


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