Crossfire Server, Trunk  R20513
Signals | Public Member Functions | Protected Member Functions | Protected Attributes
CREMapInformationManager Class Reference

#include <CREMapInformationManager.h>

Inheritance diagram for CREMapInformationManager:
Inheritance graph
Collaboration diagram for CREMapInformationManager:
Collaboration graph

Signals

void browsingMap (const QString &path)
 
void finished ()
 

Public Member Functions

QList< CREMapInformation * > allMaps ()
 
bool browseFinished () const
 
void cancel ()
 
void clearCache ()
 
 CREMapInformationManager (QObject *parent, MessageManager *messageManager, QuestManager *questManager, ScriptFileManager *scriptManager)
 
QList< CREMapInformation * > getArchetypeUse (const archetype *arch)
 
QList< CREMapInformation * > getMapsForRegion (const QString &region)
 
QList< CRERandomMap * > randomMaps ()
 
void start ()
 
virtual ~CREMapInformationManager ()
 

Protected Member Functions

void addArchetypeUse (const QString &name, CREMapInformation *map)
 
void browseMaps ()
 
void checkEvent (const object *item, CREMapInformation *map, const object *env)
 
void checkInventory (const object *item, CREMapInformation *information, const object *env)
 
CREMapInformationgetOrCreateMapInformation (const QString &path)
 
void loadCache ()
 
void process (const QString &path)
 
void storeCache ()
 

Protected Attributes

QMultiHash< QString, CREMapInformation * > myArchetypeUse
 
bool myCancelled
 
int myCurrentMap
 
QHash< QString, qint64 > myExperience
 
QHash< QString, CREMapInformation * > myInformation
 
QMutex myLock
 
MessageManagermyMessageManager
 
QuestManagermyQuestManager
 
ScriptFileManagermyScriptManager
 
QStringList myToProcess
 
QFuture< void > myWorker
 

Detailed Description

Definition at line 16 of file CREMapInformationManager.h.

Constructor & Destructor Documentation

CREMapInformationManager::CREMapInformationManager ( QObject *  parent,
MessageManager messageManager,
QuestManager questManager,
ScriptFileManager scriptManager 
)

Definition at line 53 of file CREMapInformationManager.cpp.

References myMessageManager, myQuestManager, and myScriptManager.

CREMapInformationManager::~CREMapInformationManager ( )
virtual

Definition at line 63 of file CREMapInformationManager.cpp.

References myInformation.

Member Function Documentation

void CREMapInformationManager::addArchetypeUse ( const QString &  name,
CREMapInformation map 
)
protected

Definition at line 625 of file CREMapInformationManager.cpp.

References myArchetypeUse, and myLock.

Referenced by checkInventory(), loadCache(), and process().

Here is the caller graph for this function:

QList< CREMapInformation * > CREMapInformationManager::allMaps ( )

Definition at line 343 of file CREMapInformationManager.cpp.

References myInformation, and myLock.

Referenced by CREMainWindow::onReportShops().

Here is the caller graph for this function:

bool CREMapInformationManager::browseFinished ( ) const

Definition at line 68 of file CREMapInformationManager.cpp.

References myWorker.

void CREMapInformationManager::browseMaps ( )
protected
Todo:
clear memory
Todo:
make nicer report

Definition at line 283 of file CREMapInformationManager.cpp.

References archt::clone, create_pathname(), finished(), first_archetype, first_map_ext_path, first_map_path, loadCache(), MAX_BUF, myArchetypeUse, myCancelled, myCurrentMap, myExperience, myInformation, myToProcess, archt::name, archt::next, PLAYER, process(), snprintf, storeCache(), and obj::type.

Referenced by start().

Here is the call graph for this function:

Here is the caller graph for this function:

void CREMapInformationManager::browsingMap ( const QString &  path)
signal

Referenced by process().

Here is the caller graph for this function:

void CREMapInformationManager::cancel ( )

Definition at line 337 of file CREMapInformationManager.cpp.

References myCancelled, and myWorker.

Referenced by CREMainWindow::closeEvent().

Here is the caller graph for this function:

void CREMapInformationManager::checkEvent ( const object item,
CREMapInformation map,
const object env 
)
protected
void CREMapInformationManager::checkInventory ( const object item,
CREMapInformation information,
const object env 
)
protected

Definition at line 81 of file CREMapInformationManager.cpp.

References CREMapInformation::addArchetype(), addArchetypeUse(), checkEvent(), find_archetype(), FOR_INV_FINISH, FOR_INV_PREPARE, and archt::name.

Referenced by process().

Here is the call graph for this function:

Here is the caller graph for this function:

void CREMapInformationManager::clearCache ( )

Definition at line 698 of file CREMapInformationManager.cpp.

References CRESettings::mapCacheDirectory(), myWorker, and settings.

Referenced by CREMainWindow::onClearCache().

Here is the call graph for this function:

Here is the caller graph for this function:

void CREMapInformationManager::finished ( )
signal

Referenced by browseMaps().

Here is the caller graph for this function:

QList< CREMapInformation * > CREMapInformationManager::getArchetypeUse ( const archetype arch)

Definition at line 349 of file CREMapInformationManager.cpp.

References myArchetypeUse, myLock, and archt::name.

Referenced by CREArchetypePanel::setItem().

Here is the caller graph for this function:

QList< CREMapInformation * > CREMapInformationManager::getMapsForRegion ( const QString &  region)

Definition at line 685 of file CREMapInformationManager.cpp.

References myInformation, and CREMapInformation::region().

Referenced by CREResourcesWindow::fillMaps().

Here is the call graph for this function:

Here is the caller graph for this function:

CREMapInformation * CREMapInformationManager::getOrCreateMapInformation ( const QString &  path)
protected

Definition at line 615 of file CREMapInformationManager.cpp.

References myInformation.

Referenced by process().

Here is the caller graph for this function:

void CREMapInformationManager::loadCache ( )
protected
void CREMapInformationManager::process ( const QString &  path)
protected
Todo:
get from config

Definition at line 93 of file CREMapInformationManager.cpp.

References add_map(), add_region_link(), CREMapInformation::addAccessedFrom(), CREMapInformation::addArchetype(), addArchetypeUse(), CREMapInformation::addExitTo(), ScriptFile::addHook(), CREMapInformation::addRandomMap(), browsingMap(), checkInventory(), create_pathname(), delete_map(), mapdef::difficulty, do_regions_link, EVENT_CONNECTOR, eventNames, EXIT, EXIT_PATH, CREMapInformation::exitsTo(), find_archetype(), FLAG_MONSTER, FOR_MAP_FINISH, FOR_MAP_PREPARE, get_map_info(), ScriptFileManager::getFile(), getOrCreateMapInformation(), mapdef::in_memory, shopitem::index, MAP_HEIGHT, MAP_IN_MEMORY, MAP_WIDTH, CREMapInformation::mapTime(), MAX_BUF, myCancelled, myExperience, myLock, myScriptManager, myToProcess, CREMapInformation::name, regiondef::name, shopitem::name, mapdef::name, archt::name, NR_EVENTS, mapdef::path, path_combine_and_normalize(), PLAYER_CHANGER, QUERY_FLAG, ready_map_name(), mapdef::region, ScriptFileManager::removeMap(), mapdef::reset_time, CREMapInformation::setExperience(), CREMapInformation::setLevel(), CREMapInformation::setMapTime(), CREMapInformation::setName(), CREMapInformation::setRegion(), CREMapInformation::setShopGreed(), CREMapInformation::setShopMax(), CREMapInformation::setShopMin(), CREMapInformation::setShopRace(), mapdef::shopgreed, CREMapInformation::shopItems(), mapdef::shopitems, mapdef::shopmax, mapdef::shopmin, mapdef::shoprace, start(), shopitem::strength, TELEPORTER, and mapdef::tile_path.

Referenced by browseMaps().

Here is the call graph for this function:

Here is the caller graph for this function:

QList< CRERandomMap * > CREMapInformationManager::randomMaps ( )

Definition at line 705 of file CREMapInformationManager.cpp.

References myInformation, and CREMapInformation::randomMaps().

Referenced by CREResourcesWindow::fillRandomMaps().

Here is the call graph for this function:

Here is the caller graph for this function:

void CREMapInformationManager::start ( )

Definition at line 73 of file CREMapInformationManager.cpp.

References browseMaps(), and myWorker.

Referenced by CREMainWindow::CREMainWindow(), and process().

Here is the call graph for this function:

Here is the caller graph for this function:

void CREMapInformationManager::storeCache ( )
protected

Field Documentation

QMultiHash<QString, CREMapInformation*> CREMapInformationManager::myArchetypeUse
protected

Definition at line 43 of file CREMapInformationManager.h.

Referenced by addArchetypeUse(), browseMaps(), and getArchetypeUse().

bool CREMapInformationManager::myCancelled
protected

Definition at line 47 of file CREMapInformationManager.h.

Referenced by browseMaps(), cancel(), and process().

int CREMapInformationManager::myCurrentMap
protected

Definition at line 45 of file CREMapInformationManager.h.

Referenced by browseMaps().

QHash<QString, qint64> CREMapInformationManager::myExperience
protected

Definition at line 49 of file CREMapInformationManager.h.

Referenced by browseMaps(), and process().

QHash<QString, CREMapInformation*> CREMapInformationManager::myInformation
protected
QMutex CREMapInformationManager::myLock
protected

Definition at line 48 of file CREMapInformationManager.h.

Referenced by addArchetypeUse(), allMaps(), getArchetypeUse(), and process().

MessageManager* CREMapInformationManager::myMessageManager
protected

Definition at line 39 of file CREMapInformationManager.h.

Referenced by checkEvent(), CREMapInformationManager(), and loadCache().

QuestManager* CREMapInformationManager::myQuestManager
protected

Definition at line 40 of file CREMapInformationManager.h.

Referenced by checkEvent(), CREMapInformationManager(), and loadCache().

ScriptFileManager* CREMapInformationManager::myScriptManager
protected
QStringList CREMapInformationManager::myToProcess
protected

Definition at line 44 of file CREMapInformationManager.h.

Referenced by browseMaps(), and process().

QFuture<void> CREMapInformationManager::myWorker
protected

Definition at line 46 of file CREMapInformationManager.h.

Referenced by browseFinished(), cancel(), clearCache(), and start().


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