#include <ObjectManager.h>
Public Member Functions | |
ObjectManager () | |
~ObjectManager () | |
void | reset () |
uint16 | assignObjId (Object *obj, ObjId id=0xFFFF) |
uint16 | assignActorObjId (Actor *obj, ObjId id=0xFFFF) |
bool | reserveObjId (ObjId objid) |
void | clearObjId (ObjId objid) |
Object * | getObject (ObjId objid) const |
void | objectStats () |
void | objectTypes () |
void | save (ODataSource *ods) |
bool | load (IDataSource *ids, uint32 version) |
Object * | loadObject (IDataSource *ids, uint32 version) |
Object * | loadObject (IDataSource *ids, std::string classname, uint32 version) |
Static Public Member Functions | |
static ObjectManager * | get_instance () |
static void | ConCmd_objectTypes (const Console::ArgvType &argv) |
static void | ConCmd_objectInfo (const Console::ArgvType &argv) |
Public Attributes | |
std::vector< Object * > | objects |
idMan * | objIDs |
idMan * | actorIDs |
Private Member Functions | |
void | setupLoaders () |
void | addObjectLoader (std::string classname, ObjectLoadFunc func) |
Private Attributes | |
std::map< std::string, ObjectLoadFunc > | objectloaders |
Static Private Attributes | |
static ObjectManager * | objectmanager = 0 |
Definition at line 34 of file ObjectManager.h.
ObjectManager::ObjectManager | ( | ) |
Definition at line 70 of file ObjectManager.cpp.
References actorIDs, con, MM_INFO, objectmanager, objects, objIDs, Console::Print(), and setupLoaders().
ObjectManager::~ObjectManager | ( | ) |
Definition at line 86 of file ObjectManager.cpp.
References actorIDs, con, MM_INFO, objectmanager, objIDs, Console::Print(), and reset().
void ObjectManager::addObjectLoader | ( | std::string | classname, | |
ObjectLoadFunc | func | |||
) | [inline, private] |
Definition at line 71 of file ObjectManager.h.
References objectloaders.
Referenced by setupLoaders().
Definition at line 209 of file ObjectManager.cpp.
References actorIDs, idMan::getNewID(), objects, and idMan::reserveID().
Referenced by Actor::assignObjId(), World::loadItemCachNPCData(), and RemorseGame::startGame().
Definition at line 194 of file ObjectManager.cpp.
References idMan::getNewID(), objects, objIDs, and idMan::reserveID().
Referenced by Object::assignObjId().
void ObjectManager::clearObjId | ( | ObjId | objid | ) |
Definition at line 232 of file ObjectManager.cpp.
References actorIDs, idMan::clearID(), objects, and objIDs.
Referenced by Object::clearObjId(), and Object::~Object().
void ObjectManager::ConCmd_objectInfo | ( | const Console::ArgvType & | argv | ) | [static] |
"ObjectManager::objectInfo" console command
Definition at line 166 of file ObjectManager.cpp.
References actorIDs, Object::dumpInfo(), get_instance(), getObject(), idMan::isIDUsed(), objIDs, and pout.
Referenced by GUIApp::GUIApp(), and GUIApp::~GUIApp().
void ObjectManager::ConCmd_objectTypes | ( | const Console::ArgvType & | argv | ) | [static] |
"ObjectManager::objectTypes" console command
Definition at line 161 of file ObjectManager.cpp.
References get_instance(), and objectTypes().
Referenced by GUIApp::GUIApp(), and GUIApp::~GUIApp().
static ObjectManager* ObjectManager::get_instance | ( | ) | [inline, static] |
Definition at line 40 of file ObjectManager.h.
References objectmanager.
Referenced by Object::assignObjId(), Actor::assignObjId(), Object::clearObjId(), GUIApp::ConCmd_engineStats(), ConCmd_objectInfo(), ConCmd_objectTypes(), getActor(), getContainer(), GUIApp::getGump(), getGump(), getItem(), getMainActor(), getObject(), Map::load(), Gump::loadData(), Container::loadData(), World::loadItemCachNPCData(), MusicProcess::playMusic(), GUIApp::startDragging(), U8Game::startGame(), RemorseGame::startGame(), and Object::~Object().
Definition at line 244 of file ObjectManager.cpp.
References objects.
Referenced by ConCmd_objectInfo(), getActor(), getContainer(), getGump(), getItem(), getMainActor(), getObject(), GUIApp::handleEvent(), and GUIApp::startDragging().
bool ObjectManager::load | ( | IDataSource * | ids, | |
uint32 | version | |||
) |
Definition at line 274 of file ObjectManager.cpp.
References actorIDs, GUIApp::addGump(), GUIApp::get_instance(), idMan::load(), loadObject(), objIDs, IDataSource::read(), and IDataSource::read2().
Referenced by GUIApp::loadGame().
Object * ObjectManager::loadObject | ( | IDataSource * | ids, | |
std::string | classname, | |||
uint32 | version | |||
) |
Definition at line 317 of file ObjectManager.cpp.
References actorIDs, Object::getObjId(), idMan::isIDUsed(), objectloaders, objects, objIDs, and perr.
Object * ObjectManager::loadObject | ( | IDataSource * | ids, | |
uint32 | version | |||
) |
Definition at line 304 of file ObjectManager.cpp.
References IDataSource::read(), and IDataSource::read2().
Referenced by load().
void ObjectManager::objectStats | ( | ) |
void ObjectManager::objectTypes | ( | ) |
bool ObjectManager::reserveObjId | ( | ObjId | objid | ) |
Definition at line 224 of file ObjectManager.cpp.
References actorIDs, objIDs, and idMan::reserveID().
Referenced by GUIApp::setupCoreGumps(), U8Game::startGame(), and RemorseGame::startGame().
void ObjectManager::reset | ( | ) |
Definition at line 97 of file ObjectManager.cpp.
References actorIDs, idMan::clearAll(), con, Gump::GetParent(), Item::getParent(), MM_INFO, objects, objIDs, Console::Print(), and idMan::reserveID().
Referenced by GUIApp::resetEngine(), GUIApp::shutdownGame(), and ~ObjectManager().
void ObjectManager::save | ( | ODataSource * | ods | ) |
Definition at line 249 of file ObjectManager.cpp.
References actorIDs, Item::getParent(), Gump::mustSave(), objects, objIDs, idMan::save(), and ODataSource::write2().
Referenced by GUIApp::saveGame().
void ObjectManager::setupLoaders | ( | ) | [private] |
Definition at line 353 of file ObjectManager.cpp.
References addObjectLoader().
Referenced by ObjectManager().
Definition at line 66 of file ObjectManager.h.
Referenced by assignActorObjId(), clearObjId(), ConCmd_objectInfo(), load(), loadObject(), ObjectManager(), reserveObjId(), reset(), save(), and ~ObjectManager().
std::map<std::string, ObjectLoadFunc> ObjectManager::objectloaders [private] |
ObjectManager * ObjectManager::objectmanager = 0 [static, private] |
Definition at line 75 of file ObjectManager.h.
Referenced by get_instance(), ObjectManager(), and ~ObjectManager().
std::vector<Object*> ObjectManager::objects |
Definition at line 64 of file ObjectManager.h.
Referenced by assignActorObjId(), assignObjId(), clearObjId(), getObject(), loadObject(), ObjectManager(), objectStats(), objectTypes(), reset(), and save().
Definition at line 65 of file ObjectManager.h.
Referenced by assignObjId(), clearObjId(), ConCmd_objectInfo(), load(), loadObject(), ObjectManager(), reserveObjId(), reset(), save(), and ~ObjectManager().