Crossfire Server, Trunk
ResourcesManager Class Reference

#include <ResourcesManager.h>

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

Public Slots

void archetypeModified (archetype *arch)
 
void questModified (quest_definition *quest)
 
void saveArchetypes ()
 
void saveQuests ()
 

Public Member Functions

virtual void assetDefined (const archt *arch, const std::string &filename) override
 
virtual void assetDefined (const quest_definition *asset, const std::string &filename) override
 
bool hasPendingChanges () const
 
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
 
const std::map< std::string, std::set< const quest_definition * > > & questOrigins () const
 
const recipestructrecipe (int ingredients, const QString &name) const
 
int recipeMaxIngredients () const
 
QStringList recipes (int count) const
 
 ResourcesManager ()
 
virtual ~ResourcesManager ()
 

Static Public Member Functions

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

Protected Attributes

ModifiedAssetsManager< archetypemyArchetypes
 
ModifiedAssetsManager< quest_definitionmyQuests
 
QList< QHash< QString, recipestruct * > > myRecipes
 

Additional Inherited Members

Detailed Description

Definition at line 28 of file ResourcesManager.h.

Constructor & Destructor Documentation

◆ ResourcesManager()

ResourcesManager::ResourcesManager ( )

Definition at line 24 of file ResourcesManager.cpp.

◆ ~ResourcesManager()

ResourcesManager::~ResourcesManager ( )
virtual

Definition at line 28 of file ResourcesManager.cpp.

Member Function Documentation

◆ archetypeModified

void ResourcesManager::archetypeModified ( archetype arch)
slot

Definition at line 169 of file ResourcesManager.cpp.

References archininventory::arch, and myArchetypes.

Referenced by CREArchetypePanel::commitData().

+ Here is the caller graph for this function:

◆ archetypeUse()

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

Definition at line 93 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(), and CREArchetypePanel::setItem().

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

◆ assetDefined() [1/2]

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 42 of file ResourcesManager.h.

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

Referenced by CREQuestPanel::commitData().

+ Here is the caller graph for this function:

◆ assetDefined() [2/2]

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 43 of file ResourcesManager.h.

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

+ Here is the call graph for this function:

◆ hasPendingChanges()

bool ResourcesManager::hasPendingChanges ( ) const
inline

Definition at line 53 of file ResourcesManager.h.

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

Referenced by CREMainWindow::closeEvent().

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

◆ load()

◆ originOf()

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

Definition at line 46 of file ResourcesManager.h.

References archininventory::arch, and myArchetypes.

Referenced by CREArchetypePanel::commitData().

+ Here is the caller graph for this function:

◆ originOfQuest()

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

Definition at line 49 of file ResourcesManager.h.

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

Referenced by CREQuestPanel::commitData(), and CREQuestPanel::setItem().

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

◆ origins()

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

Definition at line 45 of file ResourcesManager.h.

References myArchetypes.

◆ questModified

void ResourcesManager::questModified ( quest_definition quest)
slot

Definition at line 177 of file ResourcesManager.cpp.

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

Referenced by CREQuestPanel::commitData().

+ 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 48 of file ResourcesManager.h.

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

Referenced by CREQuestPanel::CREQuestPanel().

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

◆ recipe()

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

Definition at line 85 of file ResourcesManager.cpp.

References myRecipes, and give::name.

Referenced by CREResourcesWindow::fillFormulae().

+ Here is the caller graph for this function:

◆ recipeMaxIngredients()

int ResourcesManager::recipeMaxIngredients ( ) const

Definition at line 70 of file ResourcesManager.cpp.

References myRecipes.

Referenced by CREResourcesWindow::fillFormulae().

+ Here is the caller graph for this function:

◆ recipes()

QStringList ResourcesManager::recipes ( int  count) const

Definition at line 75 of file ResourcesManager.cpp.

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

Referenced by CREResourcesWindow::fillFormulae(), and load().

+ Here is the caller graph for this function:

◆ saveArchetypes

void ResourcesManager::saveArchetypes ( )
slot

Definition at line 173 of file ResourcesManager.cpp.

References myArchetypes.

◆ saveQuests

void ResourcesManager::saveQuests ( )
slot

Definition at line 181 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:

Field Documentation

◆ myArchetypes

ModifiedAssetsManager<archetype> ResourcesManager::myArchetypes
protected

◆ myQuests

ModifiedAssetsManager<quest_definition> ResourcesManager::myQuests
protected

◆ myRecipes

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

Definition at line 62 of file ResourcesManager.h.

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


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