Crossfire Server, Trunk
ResourcesManager Class Reference

#include <ResourcesManager.h>

+ Inheritance diagram for ResourcesManager:
+ Collaboration diagram for ResourcesManager:

Public Slots

void archetypeModified (archetype *arch)
 
void generalMessageModified (GeneralMessage *message)
 
void questModified (quest_definition *quest)
 
void saveArchetypes ()
 
void saveArtifacts ()
 
void saveGeneralMessages ()
 
void saveQuests ()
 
void saveTreasures ()
 
void treasureModified (treasurelist *treasure)
 

Public Member Functions

virtual void assetDefined (const archt *arch, const std::string &filename) override
 
virtual void assetDefined (const artifact *asset, const std::string &filename) override
 
virtual void assetDefined (const GeneralMessage *asset, const std::string &filename) override
 
virtual void assetDefined (const quest_definition *asset, const std::string &filename) override
 
virtual void assetDefined (const treasurelist *asset, const std::string &filename) override
 
CREMapInformationManagergetMapInformationManager ()
 
const recipestructgetRecipe (int ingredients, const QString &name) const
 
bool hasPendingChanges () const
 
LicenseManagerlicenseManager ()
 
void load ()
 
std::string originOf (const archt *arch) const
 
std::string originOfQuest (const quest_definition *quest) const
 
const std::map< std::string, std::set< const archt * > > & origins () const
 
std::vector< std::string > questFiles () const
 
const std::map< std::string, std::set< const quest_definition * > > & questOrigins () const
 
int recipeMaxIngredients () const
 
QStringList recipes (int count) const
 
void remove (treasure *tr)
 
 ResourcesManager ()
 
void setMapInformationManager (CREMapInformationManager *mapInformationManager)
 
AssetWrapperwrap (Animations *anim, AssetWrapper *parent)
 
ArchetypeWrapperwrap (archt *arch, AssetWrapper *parent)
 
AssetWrapperwrap (artifact *art, AssetWrapper *parent)
 
AssetWrapperwrap (artifactlist *al, AssetWrapper *parent)
 
AssetWrapperwrap (Face *face, AssetWrapper *parent)
 
AssetWrapperwrap (face_sets *fs, AssetWrapper *parent)
 
AssetWrapperwrap (GeneralMessage *message, AssetWrapper *parent)
 
ObjectWrapperwrap (object *ob, AssetWrapper *parent)
 
AssetWrapperwrap (quest_definition *quest, AssetWrapper *parent)
 
AssetWrapperwrap (quest_step_definition *step, AssetWrapper *parent)
 
AssetWrapperwrap (recipe *rc, AssetWrapper *parent)
 
AssetWrapperwrap (recipelist *list, AssetWrapper *parent)
 
AssetWrapperwrap (region *reg, AssetWrapper *parent)
 
AssetWrapperwrap (treasure *tr, AssetWrapper *parent)
 
AssetWrapperwrap (treasurelist *tr, AssetWrapper *parent)
 
virtual ~ResourcesManager ()
 

Static Public Member Functions

static void archetypeUse (const archt *item, CREMapInformationManager *store, AssetUseCallback callback)
 

Protected Attributes

ModifiedAssetsManager< archetypemyArchetypes
 
ModifiedAssetsManager< artifactmyArtifacts
 
ModifiedAssetsManager< GeneralMessagemyGeneralMessages
 
LicenseManager myLicenseManager
 
CREMapInformationManagermyMapInformationManager
 
ModifiedAssetsManager< quest_definitionmyQuests
 
QList< QHash< QString, recipestruct * > > myRecipes
 
ModifiedAssetsManager< treasurelistmyTreasures
 
AssetWrapperManager< Animations, AnimationWrappermyWrappedAnimations
 
AssetWrapperManager< archt, ArchetypeWrappermyWrappedArchetypes
 
AssetWrapperManager< artifactlist, ArtifactListWrappermyWrappedArtifactLists
 
AssetWrapperManager< artifact, ArtifactWrappermyWrappedArtifacts
 
AssetWrapperManager< Face, FaceWrappermyWrappedFaces
 
AssetWrapperManager< face_sets, FacesetsWrappermyWrappedFacesets
 
AssetWrapperManager< GeneralMessage, GeneralMessageWrappermyWrappedMessages
 
AssetWrapperManager< object, ObjectWrappermyWrappedObjects
 
AssetWrapperManager< quest_definition, QuestWrappermyWrappedQuests
 
AssetWrapperManager< quest_step_definition, QuestStepWrappermyWrappedQuestSteps
 
AssetWrapperManager< recipelist, RecipeListWrappermyWrappedRecipeLists
 
AssetWrapperManager< recipe, RecipeWrappermyWrappedRecipes
 
AssetWrapperManager< region, RegionWrappermyWrappedRegions
 
AssetWrapperManager< treasurelist, TreasureListWrappermyWrappedTreasureLists
 
AssetWrapperManager< treasure, TreasureWrappermyWrappedTreasures
 

Additional Inherited Members

Detailed Description

Class managing all assets, tracking in which file they are, which are modified, and such.

Definition at line 80 of file ResourcesManager.h.

Constructor & Destructor Documentation

◆ ResourcesManager()

ResourcesManager::ResourcesManager ( )

Definition at line 43 of file ResourcesManager.cpp.

◆ ~ResourcesManager()

ResourcesManager::~ResourcesManager ( )
virtual

Definition at line 48 of file ResourcesManager.cpp.

Member Function Documentation

◆ archetypeModified

void ResourcesManager::archetypeModified ( archetype arch)
slot

Definition at line 217 of file ResourcesManager.cpp.

References archininventory::arch, and myArchetypes.

Referenced by ArchetypeWrapper::wasModified().

+ Here is the caller graph for this function:

◆ archetypeUse()

void ResourcesManager::archetypeUse ( const archt item,
CREMapInformationManager store,
AssetUseCallback  callback 
)
static

Definition at line 141 of file ResourcesManager.cpp.

References archininventory::arch, AssetsManager::archetypes(), AssetsCollection< T, Key >::each(), getManager(), if(), guildoracle::list, object_get_value(), sstring, Floor::t, and AssetsManager::treasures().

Referenced by CREMainWindow::onReportArchetypes().

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

◆ assetDefined() [1/5]

virtual void ResourcesManager::assetDefined ( const archt asset,
const std::string &  filename 
)
inlineoverridevirtual

Function called when an asset is defined in a file. It may be called multiple times with the same asset.

Parameters
assetasset which is defined.
filenamefull pathname of where the asset was defined.

Reimplemented from AssetsTracker.

Definition at line 101 of file ResourcesManager.h.

References archininventory::arch, npc_dialog::filename, and myArchetypes.

Referenced by QuestsWrapper::addQuest().

+ Here is the caller graph for this function:

◆ assetDefined() [2/5]

virtual void ResourcesManager::assetDefined ( const artifact asset,
const std::string &  filename 
)
inlineoverridevirtual

Function called when an asset is defined in a file. It may be called multiple times with the same asset.

Parameters
assetasset which is defined.
filenamefull pathname of where the asset was defined.

Reimplemented from AssetsTracker.

Definition at line 105 of file ResourcesManager.h.

References npc_dialog::filename, and myArtifacts.

◆ assetDefined() [3/5]

virtual void ResourcesManager::assetDefined ( const GeneralMessage asset,
const std::string &  filename 
)
inlineoverridevirtual

Function called when an asset is defined in a file. It may be called multiple times with the same asset.

Parameters
assetasset which is defined.
filenamefull pathname of where the asset was defined.

Reimplemented from AssetsTracker.

Definition at line 104 of file ResourcesManager.h.

References ModifiedAssetsManager< T >::assetDefined(), npc_dialog::filename, and myGeneralMessages.

+ Here is the call graph for this function:

◆ assetDefined() [4/5]

virtual void ResourcesManager::assetDefined ( const quest_definition asset,
const std::string &  filename 
)
inlineoverridevirtual

Function called when an asset is defined in a file. It may be called multiple times with the same asset.

Parameters
assetasset which is defined.
filenamefull pathname of where the asset was defined.

Reimplemented from AssetsTracker.

Definition at line 102 of file ResourcesManager.h.

References ModifiedAssetsManager< T >::assetDefined(), npc_dialog::filename, and myQuests.

+ Here is the call graph for this function:

◆ assetDefined() [5/5]

virtual void ResourcesManager::assetDefined ( const treasurelist asset,
const std::string &  filename 
)
inlineoverridevirtual

Function called when an asset is defined in a file. It may be called multiple times with the same asset.

Parameters
assetasset which is defined.
filenamefull pathname of where the asset was defined.

Reimplemented from AssetsTracker.

Definition at line 103 of file ResourcesManager.h.

References npc_dialog::filename, and myTreasures.

◆ generalMessageModified

void ResourcesManager::generalMessageModified ( GeneralMessage message)
slot

Definition at line 260 of file ResourcesManager.cpp.

References ModifiedAssetsManager< T >::assetModified(), and myGeneralMessages.

Referenced by GeneralMessageWrapper::wasModified().

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

◆ getMapInformationManager()

CREMapInformationManager* ResourcesManager::getMapInformationManager ( )
inline

Definition at line 91 of file ResourcesManager.h.

References myMapInformationManager.

Referenced by AllAssets::AllAssets(), RegionWrapper::mapAdded(), CREMainWindow::onReportResetGroups(), and RegionWrapper::RegionWrapper().

+ Here is the caller graph for this function:

◆ getRecipe()

const recipe * ResourcesManager::getRecipe ( int  ingredients,
const QString &  name 
) const

Definition at line 133 of file ResourcesManager.cpp.

References myRecipes, and give::name.

◆ hasPendingChanges()

bool ResourcesManager::hasPendingChanges ( ) const
inline

Definition at line 116 of file ResourcesManager.h.

References ModifiedAssetsManager< T >::hasPendingChanges(), myArchetypes, myArtifacts, myGeneralMessages, myQuests, and myTreasures.

Referenced by CREMainWindow::closeEvent().

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

◆ licenseManager()

LicenseManager* ResourcesManager::licenseManager ( )
inline

Definition at line 147 of file ResourcesManager.h.

References myLicenseManager.

Referenced by CREResourcesWindow::CREResourcesWindow(), CREMainWindow::onReportLicenses(), CREMainWindow::onToolReloadAssets(), and CREFacePanel::updateItem().

+ Here is the caller graph for this function:

◆ load()

◆ originOf()

std::string ResourcesManager::originOf ( const archt arch) const
inline

Definition at line 108 of file ResourcesManager.h.

References archininventory::arch, and myArchetypes.

Referenced by ArchetypeWrapper::setRaw().

+ Here is the caller graph for this function:

◆ originOfQuest()

std::string ResourcesManager::originOfQuest ( const quest_definition quest) const
inline

Definition at line 111 of file ResourcesManager.h.

References myQuests, and ModifiedAssetsManager< T >::originOf().

+ Here is the call graph for this function:

◆ origins()

const std::map<std::string, std::set<const archt*> >& ResourcesManager::origins ( ) const
inline

Definition at line 107 of file ResourcesManager.h.

References myArchetypes.

Referenced by saveTreasures().

+ Here is the caller graph for this function:

◆ questFiles()

std::vector<std::string> ResourcesManager::questFiles ( ) const
inline

Definition at line 112 of file ResourcesManager.h.

References ModifiedAssetsManager< T >::files(), and myQuests.

Referenced by QuestsWrapper::addQuest().

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

◆ questModified

void ResourcesManager::questModified ( quest_definition quest)
slot

Definition at line 225 of file ResourcesManager.cpp.

References ModifiedAssetsManager< T >::assetModified(), and myQuests.

Referenced by QuestsWrapper::addQuest(), and QuestWrapper::wasModified().

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

◆ questOrigins()

const std::map<std::string, std::set<const quest_definition*> >& ResourcesManager::questOrigins ( ) const
inline

Definition at line 110 of file ResourcesManager.h.

References myQuests, and ModifiedAssetsManager< T >::origins().

+ Here is the call graph for this function:

◆ recipeMaxIngredients()

int ResourcesManager::recipeMaxIngredients ( ) const

Definition at line 118 of file ResourcesManager.cpp.

References myRecipes.

Referenced by RecipesWrapper::childrenCount().

+ Here is the caller graph for this function:

◆ recipes()

QStringList ResourcesManager::recipes ( int  count) const

Definition at line 123 of file ResourcesManager.cpp.

References disinfect::count, hall_of_fame::keys, and myRecipes.

Referenced by load().

+ Here is the caller graph for this function:

◆ remove()

void ResourcesManager::remove ( treasure tr)
inline

Definition at line 145 of file ResourcesManager.h.

References myWrappedTreasures.

Referenced by TreasureWrapper::doRemoveChild(), and TreasureListWrapper::removeChild().

+ Here is the caller graph for this function:

◆ saveArchetypes

void ResourcesManager::saveArchetypes ( )
slot

Definition at line 221 of file ResourcesManager.cpp.

References myArchetypes.

◆ saveArtifacts

void ResourcesManager::saveArtifacts ( )
slot

Definition at line 268 of file ResourcesManager.cpp.

References myArtifacts.

◆ saveGeneralMessages

void ResourcesManager::saveGeneralMessages ( )
slot

Definition at line 264 of file ResourcesManager.cpp.

References myGeneralMessages, and ModifiedAssetsManager< T >::saveModifiedAssets().

+ Here is the call graph for this function:

◆ saveQuests

void ResourcesManager::saveQuests ( )
slot

Definition at line 229 of file ResourcesManager.cpp.

References myQuests, and ModifiedAssetsManager< T >::saveModifiedAssets().

Referenced by CREMainWindow::onSaveQuests().

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

◆ saveTreasures

void ResourcesManager::saveTreasures ( )
slot

◆ setMapInformationManager()

void ResourcesManager::setMapInformationManager ( CREMapInformationManager mapInformationManager)
inline

Definition at line 88 of file ResourcesManager.h.

References myMapInformationManager.

Referenced by CREMainWindow::CREMainWindow().

+ Here is the caller graph for this function:

◆ treasureModified

void ResourcesManager::treasureModified ( treasurelist treasure)
slot

Definition at line 233 of file ResourcesManager.cpp.

References myTreasures.

Referenced by TreasureListWrapper::wasModified().

+ Here is the caller graph for this function:

◆ wrap() [1/15]

AssetWrapper* ResourcesManager::wrap ( Animations anim,
AssetWrapper parent 
)
inline

Definition at line 129 of file ResourcesManager.h.

References animate::anim, and myWrappedAnimations.

◆ wrap() [2/15]

◆ wrap() [3/15]

AssetWrapper* ResourcesManager::wrap ( artifact art,
AssetWrapper parent 
)
inline

Definition at line 138 of file ResourcesManager.h.

References AssetWrapper::modified(), myArtifacts, and myWrappedArtifacts.

◆ wrap() [4/15]

AssetWrapper* ResourcesManager::wrap ( artifactlist al,
AssetWrapper parent 
)
inline

Definition at line 137 of file ResourcesManager.h.

References myWrappedArtifactLists.

◆ wrap() [5/15]

AssetWrapper* ResourcesManager::wrap ( Face face,
AssetWrapper parent 
)
inline

Definition at line 128 of file ResourcesManager.h.

References myWrappedFaces, and AssetWrapperManager< A, W >::wrap().

+ Here is the call graph for this function:

◆ wrap() [6/15]

AssetWrapper* ResourcesManager::wrap ( face_sets fs,
AssetWrapper parent 
)
inline

Definition at line 133 of file ResourcesManager.h.

References myWrappedFacesets, and AssetWrapperManager< A, W >::wrap().

+ Here is the call graph for this function:

◆ wrap() [7/15]

AssetWrapper* ResourcesManager::wrap ( GeneralMessage message,
AssetWrapper parent 
)
inline

Definition at line 134 of file ResourcesManager.h.

References diamondslots::message, myWrappedMessages, and AssetWrapperManager< A, W >::wrap().

+ Here is the call graph for this function:

◆ wrap() [8/15]

ObjectWrapper* ResourcesManager::wrap ( object ob,
AssetWrapper parent 
)
inline

Definition at line 127 of file ResourcesManager.h.

References myWrappedObjects, and guildjoin::ob.

◆ wrap() [9/15]

AssetWrapper* ResourcesManager::wrap ( quest_definition quest,
AssetWrapper parent 
)
inline

Definition at line 135 of file ResourcesManager.h.

References myWrappedQuests, and AssetWrapperManager< A, W >::wrap().

+ Here is the call graph for this function:

◆ wrap() [10/15]

AssetWrapper* ResourcesManager::wrap ( quest_step_definition step,
AssetWrapper parent 
)
inline

Definition at line 136 of file ResourcesManager.h.

References myWrappedQuestSteps, and AssetWrapperManager< A, W >::wrap().

+ Here is the call graph for this function:

◆ wrap() [11/15]

AssetWrapper* ResourcesManager::wrap ( recipe rc,
AssetWrapper parent 
)
inline

Definition at line 144 of file ResourcesManager.h.

References myWrappedRecipes.

◆ wrap() [12/15]

AssetWrapper* ResourcesManager::wrap ( recipelist list,
AssetWrapper parent 
)
inline

Definition at line 143 of file ResourcesManager.h.

References guildoracle::list, and myWrappedRecipeLists.

◆ wrap() [13/15]

AssetWrapper* ResourcesManager::wrap ( region reg,
AssetWrapper parent 
)
inline

Definition at line 132 of file ResourcesManager.h.

References myWrappedRegions.

◆ wrap() [14/15]

AssetWrapper* ResourcesManager::wrap ( treasure tr,
AssetWrapper parent 
)
inline

Definition at line 131 of file ResourcesManager.h.

References myWrappedTreasures.

◆ wrap() [15/15]

AssetWrapper* ResourcesManager::wrap ( treasurelist tr,
AssetWrapper parent 
)
inline

Definition at line 130 of file ResourcesManager.h.

References myWrappedTreasureLists.

Field Documentation

◆ myArchetypes

ModifiedAssetsManager<archetype> ResourcesManager::myArchetypes
protected

◆ myArtifacts

ModifiedAssetsManager<artifact> ResourcesManager::myArtifacts
protected

Definition at line 167 of file ResourcesManager.h.

Referenced by assetDefined(), hasPendingChanges(), saveArtifacts(), and wrap().

◆ myGeneralMessages

ModifiedAssetsManager<GeneralMessage> ResourcesManager::myGeneralMessages
protected

◆ myLicenseManager

LicenseManager ResourcesManager::myLicenseManager
protected

Definition at line 183 of file ResourcesManager.h.

Referenced by licenseManager(), and load().

◆ myMapInformationManager

CREMapInformationManager* ResourcesManager::myMapInformationManager
protected

Definition at line 161 of file ResourcesManager.h.

Referenced by getMapInformationManager(), and setMapInformationManager().

◆ myQuests

◆ myRecipes

QList<QHash<QString, recipestruct*> > ResourcesManager::myRecipes
protected

Definition at line 162 of file ResourcesManager.h.

Referenced by getRecipe(), load(), recipeMaxIngredients(), and recipes().

◆ myTreasures

ModifiedAssetsManager<treasurelist> ResourcesManager::myTreasures
protected

◆ myWrappedAnimations

AssetWrapperManager<Animations, AnimationWrapper> ResourcesManager::myWrappedAnimations
protected

Definition at line 171 of file ResourcesManager.h.

Referenced by wrap().

◆ myWrappedArchetypes

AssetWrapperManager<archt, ArchetypeWrapper> ResourcesManager::myWrappedArchetypes
protected

Definition at line 168 of file ResourcesManager.h.

Referenced by wrap().

◆ myWrappedArtifactLists

AssetWrapperManager<artifactlist, ArtifactListWrapper> ResourcesManager::myWrappedArtifactLists
protected

Definition at line 179 of file ResourcesManager.h.

Referenced by wrap().

◆ myWrappedArtifacts

AssetWrapperManager<artifact, ArtifactWrapper> ResourcesManager::myWrappedArtifacts
protected

Definition at line 180 of file ResourcesManager.h.

Referenced by wrap().

◆ myWrappedFaces

AssetWrapperManager<Face, FaceWrapper> ResourcesManager::myWrappedFaces
protected

Definition at line 170 of file ResourcesManager.h.

Referenced by wrap().

◆ myWrappedFacesets

AssetWrapperManager<face_sets, FacesetsWrapper> ResourcesManager::myWrappedFacesets
protected

Definition at line 175 of file ResourcesManager.h.

Referenced by wrap().

◆ myWrappedMessages

AssetWrapperManager<GeneralMessage, GeneralMessageWrapper> ResourcesManager::myWrappedMessages
protected

Definition at line 176 of file ResourcesManager.h.

Referenced by wrap().

◆ myWrappedObjects

AssetWrapperManager<object, ObjectWrapper> ResourcesManager::myWrappedObjects
protected

Definition at line 169 of file ResourcesManager.h.

Referenced by wrap().

◆ myWrappedQuests

AssetWrapperManager<quest_definition, QuestWrapper> ResourcesManager::myWrappedQuests
protected

Definition at line 177 of file ResourcesManager.h.

Referenced by wrap().

◆ myWrappedQuestSteps

AssetWrapperManager<quest_step_definition, QuestStepWrapper> ResourcesManager::myWrappedQuestSteps
protected

Definition at line 178 of file ResourcesManager.h.

Referenced by wrap().

◆ myWrappedRecipeLists

AssetWrapperManager<recipelist, RecipeListWrapper> ResourcesManager::myWrappedRecipeLists
protected

Definition at line 181 of file ResourcesManager.h.

Referenced by wrap().

◆ myWrappedRecipes

AssetWrapperManager<recipe, RecipeWrapper> ResourcesManager::myWrappedRecipes
protected

Definition at line 182 of file ResourcesManager.h.

Referenced by wrap().

◆ myWrappedRegions

AssetWrapperManager<region, RegionWrapper> ResourcesManager::myWrappedRegions
protected

Definition at line 174 of file ResourcesManager.h.

Referenced by wrap().

◆ myWrappedTreasureLists

AssetWrapperManager<treasurelist, TreasureListWrapper> ResourcesManager::myWrappedTreasureLists
protected

Definition at line 172 of file ResourcesManager.h.

Referenced by wrap().

◆ myWrappedTreasures

AssetWrapperManager<treasure, TreasureWrapper> ResourcesManager::myWrappedTreasures
protected

Definition at line 173 of file ResourcesManager.h.

Referenced by remove(), and wrap().


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