Crossfire Server, Trunk
|
#include <TreasureListWrapper.h>
Public Member Functions | |
virtual bool | canDrag () const override |
virtual bool | canDrop (const QMimeData *data, int row) const override |
virtual AssetWrapper * | child (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) | |
treasurelist * | wrappedItem () const |
Public Member Functions inherited from AssetWrapper | |
AssetWrapper (AssetWrapper *parent, const QString &panelName="empty") | |
virtual QString | displayPanelName () const |
AssetWrapper * | displayParent () const |
virtual void | fillMenu (QMenu *) |
void | markModified (ChangeType change, int extra=0) |
AssetWrapper * | self () |
void | setDisplayParent (AssetWrapper *parent) |
virtual | ~AssetWrapper () override |
Protected Member Functions | |
virtual void | wasModified (AssetWrapper *asset, ChangeType type, int extra) override |
Protected Attributes | |
ResourcesManager * | myResources |
Protected Attributes inherited from AssetTWrapper< treasurelist > | |
treasurelist * | myWrappedItem |
Protected Attributes inherited from AssetWrapper | |
QString | myPanelName |
AssetWrapper * | myParent |
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" |
Definition at line 27 of file TreasureListWrapper.h.
TreasureListWrapper::TreasureListWrapper | ( | AssetWrapper * | parent, |
treasurelist * | list, | ||
ResourcesManager * | resources | ||
) |
Definition at line 22 of file TreasureListWrapper.cpp.
|
inlineoverridevirtual |
Reimplemented from AssetWrapper.
Definition at line 46 of file TreasureListWrapper.h.
|
overridevirtual |
Reimplemented from AssetWrapper.
Definition at line 103 of file TreasureListWrapper.cpp.
References MimeUtils::Archetype, navar-midane_time::data, and MimeUtils::TreasureList.
|
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().
|
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().
|
overridevirtual |
Reimplemented from AssetWrapper.
Definition at line 37 of file TreasureListWrapper.cpp.
References itemCount.
Referenced by drop().
|
inlineoverridevirtual |
Reimplemented from AssetWrapper.
Definition at line 39 of file TreasureListWrapper.h.
References CREPixmap::getTreasureIcon(), CREPixmap::getTreasureOneIcon(), AssetTWrapper< treasurelist >::myWrappedItem, and treasurelist::total_chance.
|
inlineoverridevirtual |
Implements AssetWrapper.
Definition at line 38 of file TreasureListWrapper.h.
References AssetTWrapper< treasurelist >::myWrappedItem, and treasurelist::name.
|
overridevirtual |
Reimplemented from AssetWrapper.
Definition at line 96 of file TreasureListWrapper.cpp.
References navar-midane_time::data, AssetTWrapper< treasurelist >::myWrappedItem, treasurelist::name, and MimeUtils::TreasureList.
|
overridevirtual |
Reimplemented from AssetWrapper.
Definition at line 110 of file TreasureListWrapper.cpp.
References add_string(), AssetWrapper::AfterChildAdd, archininventory::arch, MimeUtils::Archetype, AssetWrapper::AssetUpdated, AssetWrapper::BeforeChildAdd, childrenCount(), navar-midane_time::data, MimeUtils::extract(), fixTotalChance(), getManager(), guildoracle::list, lists, AssetWrapper::markModified(), AssetWrapper::modified(), AssetTWrapper< treasurelist >::myWrappedItem, treasurelist::total_chance, treasure_insert(), and MimeUtils::TreasureList.
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().
|
inline |
Definition at line 53 of file TreasureListWrapper.h.
References AssetTWrapper< treasurelist >::myWrappedItem, and treasurelist::total_chance.
int TreasureListWrapper::itemCount | ( | ) | const |
|
overridevirtual |
Reimplemented from AssetWrapper.
Definition at line 141 of file TreasureListWrapper.cpp.
References AssetWrapper::AfterChildRemove, AssetWrapper::AssetUpdated, AssetWrapper::BeforeChildRemove, child(), childIndex(), fixTotalChance(), npc_dialog::index, AssetWrapper::markModified(), myResources, AssetTWrapper< treasurelist >::myWrappedItem, ResourcesManager::remove(), Floor::t, treasurelist::total_chance, and treasure_remove_item().
void TreasureListWrapper::setSingleItem | ( | bool | isSingle | ) |
Definition at line 63 of file TreasureListWrapper.cpp.
References AssetWrapper::AssetUpdated, fixTotalChance(), isSingleItem, treasurelist::items, AssetWrapper::markModified(), AssetTWrapper< treasurelist >::myWrappedItem, and treasurelist::total_chance.
|
inline |
Definition at line 51 of file TreasureListWrapper.h.
References AssetTWrapper< treasurelist >::myWrappedItem, and treasurelist::total_chance.
|
overridevirtual |
Reimplemented from AssetWrapper.
Definition at line 157 of file TreasureListWrapper.cpp.
References AssetWrapper::ChildrenMayUse, and AssetWrapper::DoesntUse.
|
overrideprotectedvirtual |
Reimplemented from AssetWrapper.
Definition at line 84 of file TreasureListWrapper.cpp.
References AssetWrapper::AssetUpdated, childIndex(), fixTotalChance(), AssetWrapper::markModified(), myResources, AssetTWrapper< treasurelist >::myWrappedItem, treasurelist::total_chance, ResourcesManager::treasureModified(), is_valid_types_gen::type, and AssetWrapper::wasModified().
|
protected |
Definition at line 60 of file TreasureListWrapper.h.
Referenced by child(), childIndex(), removeChild(), and wasModified().
|
readwrite |
Definition at line 33 of file TreasureListWrapper.h.
Referenced by setSingleItem().
|
read |
Definition at line 32 of file TreasureListWrapper.h.
Referenced by childrenCount().
|
read |
Definition at line 30 of file TreasureListWrapper.h.
|
read |
Definition at line 31 of file TreasureListWrapper.h.