ObjectManager Class Reference

#include <ObjectManager.h>

List of all members.

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)
ObjectgetObject (ObjId objid) const
void objectStats ()
void objectTypes ()
void save (ODataSource *ods)
bool load (IDataSource *ids, uint32 version)
ObjectloadObject (IDataSource *ids, uint32 version)
ObjectloadObject (IDataSource *ids, std::string classname, uint32 version)

Static Public Member Functions

static ObjectManagerget_instance ()
static void ConCmd_objectTypes (const Console::ArgvType &argv)
static void ConCmd_objectInfo (const Console::ArgvType &argv)

Public Attributes

std::vector< Object * > objects
idManobjIDs
idManactorIDs

Private Member Functions

void setupLoaders ()
void addObjectLoader (std::string classname, ObjectLoadFunc func)

Private Attributes

std::map< std::string, ObjectLoadFuncobjectloaders

Static Private Attributes

static ObjectManagerobjectmanager = 0


Detailed Description

Definition at line 34 of file ObjectManager.h.


Constructor & Destructor Documentation

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().


Member Function Documentation

void ObjectManager::addObjectLoader ( std::string  classname,
ObjectLoadFunc  func 
) [inline, private]

Definition at line 71 of file ObjectManager.h.

References objectloaders.

Referenced by setupLoaders().

uint16 ObjectManager::assignActorObjId ( Actor obj,
ObjId  id = 0xFFFF 
)

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().

uint16 ObjectManager::assignObjId ( Object obj,
ObjId  id = 0xFFFF 
)

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().

Object * ObjectManager::getObject ( ObjId  objid  )  const

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 (  ) 

Definition at line 126 of file ObjectManager.cpp.

References objects, and pout.

Referenced by GUIApp::ConCmd_engineStats().

void ObjectManager::objectTypes (  ) 

Definition at line 145 of file ObjectManager.cpp.

References objects, and pout.

Referenced by ConCmd_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().


Member Data Documentation

idMan* ObjectManager::actorIDs

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]

Definition at line 73 of file ObjectManager.h.

Referenced by addObjectLoader(), and loadObject().

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().

idMan* ObjectManager::objIDs

Definition at line 65 of file ObjectManager.h.

Referenced by assignObjId(), clearObjId(), ConCmd_objectInfo(), load(), loadObject(), ObjectManager(), reserveObjId(), reset(), save(), and ~ObjectManager().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 22:29:42 2007 for pentagram by  doxygen 1.4.7