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
 
const QString artifact () 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 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
 
qint8 listMagicAdjustment () const
 
quint8 listMagicValue () const
 
uint8_t magic () const
 
uint16_t nrof () const
 
virtual void removeChild (AssetWrapper *child) override
 
void setArch (const archetype *arch)
 
void setArtifact (const QString &art)
 
void setChance (uint8_t chance)
 
void setList (const treasurelist *list)
 
void setListMagicAdjustment (qint8 value)
 
void setListMagicValue (quint8 value)
 
void setMagic (uint8_t magic)
 
void setNrof (uint16_t nrof)
 
 TreasureWrapper (AssetWrapper *parent, treasure *tr, ResourcesManager *resources)
 
virtual PossibleUse uses (const AssetWrapper *asset, std::string &) const override
 
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)
 
AssetWrapperself ()
 
void setDisplayParent (AssetWrapper *parent)
 
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
 
QString artifact
 
quint8 chance
 
const treasurelist list
 
qint8 list_magic_adjustment
 
quint8 list_magic_value
 
quint8 magic
 
quint16 nrof
 
- 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 }
 
- 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

Wrapper for a treasure item.

Definition at line 33 of file TreasureWrapper.h.

Constructor & Destructor Documentation

◆ TreasureWrapper()

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

◆ ~TreasureWrapper()

TreasureWrapper::~TreasureWrapper ( )
virtual

Definition at line 39 of file TreasureWrapper.cpp.

Member Function Documentation

◆ addChild()

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

Definition at line 168 of file TreasureWrapper.cpp.

References arch, doAddChild(), myNextNo, myNextYes, AssetTWrapper< treasure >::myWrappedItem, treasure::next_no, and treasure::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

◆ artifact()

const QString TreasureWrapper::artifact ( ) const

◆ canDrop()

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

Reimplemented from AssetWrapper.

Definition at line 178 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 98 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 114 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 87 of file TreasureWrapper.cpp.

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

+ 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 157 of file TreasureWrapper.cpp.

References add_string(), AssetWrapper::AfterChildAdd, arch, AssetWrapper::BeforeChildAdd, get_empty_treasure(), npc_dialog::index, AssetWrapper::markModified(), AssetWithArtifacts< treasure >::myResources, treasurelist::name, and archetype::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 136 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 185 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 298 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

◆ listMagicAdjustment()

qint8 TreasureWrapper::listMagicAdjustment ( ) const

◆ listMagicValue()

quint8 TreasureWrapper::listMagicValue ( ) 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 147 of file TreasureWrapper.cpp.

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

+ Here is the call graph for this function:

◆ setArch()

◆ setArtifact()

void TreasureWrapper::setArtifact ( const QString &  art)

◆ setChance()

void TreasureWrapper::setChance ( uint8_t  chance)

Definition at line 201 of file TreasureWrapper.cpp.

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

+ Here is the call graph for this function:

◆ setList()

◆ setListMagicAdjustment()

void TreasureWrapper::setListMagicAdjustment ( qint8  value)

◆ setListMagicValue()

void TreasureWrapper::setListMagicValue ( quint8  value)

◆ setMagic()

void TreasureWrapper::setMagic ( uint8_t  magic)

Definition at line 212 of file TreasureWrapper.cpp.

References AssetWrapper::AssetUpdated, magic, treasure::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 223 of file TreasureWrapper.cpp.

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

+ Here is the call graph for this function:

◆ swapYesNo

void TreasureWrapper::swapYesNo ( )
slot

◆ uses()

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

Field Documentation

◆ myNextNo

TreasureYesNo* TreasureWrapper::myNextNo
protected

◆ myNextYes

TreasureYesNo* TreasureWrapper::myNextYes
protected

Property Documentation

◆ arch

const archetype * TreasureWrapper::arch
readwrite

Definition at line 42 of file TreasureWrapper.h.

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

◆ artifact

const QString TreasureWrapper::artifact
readwrite

Definition at line 43 of file TreasureWrapper.h.

◆ chance

uint8_t TreasureWrapper::chance
readwrite

Definition at line 36 of file TreasureWrapper.h.

Referenced by setChance().

◆ list

const treasurelist * TreasureWrapper::list
readwrite

Definition at line 39 of file TreasureWrapper.h.

Referenced by drop(), setList(), and uses().

◆ list_magic_adjustment

qint8 TreasureWrapper::list_magic_adjustment
readwrite

Definition at line 41 of file TreasureWrapper.h.

◆ list_magic_value

quint8 TreasureWrapper::list_magic_value
readwrite

Definition at line 40 of file TreasureWrapper.h.

◆ magic

uint8_t TreasureWrapper::magic
readwrite

Definition at line 37 of file TreasureWrapper.h.

Referenced by setMagic().

◆ nrof

uint16_t TreasureWrapper::nrof
readwrite

Definition at line 38 of file TreasureWrapper.h.

Referenced by setNrof().


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