#include <World.h>
Public Member Functions | |
World () | |
~World () | |
void | clear () |
void | reset () |
void | initMaps () |
void | loadNonFixed (IDataSource *ds) |
void | loadItemCachNPCData (IDataSource *itemcach, IDataSource *npcdata) |
CurrentMap * | getCurrentMap () const |
bool | switchMap (uint32 newmap) |
void | etherealPush (ObjId objid) |
bool | etherealEmpty () |
ObjId | etherealPeek () |
void | etherealRemove (ObjId objid) |
void | worldStats () |
void | saveMaps (ODataSource *ods) |
bool | loadMaps (IDataSource *ids, uint32 version) |
void | save (ODataSource *ods) |
bool | load (IDataSource *ids, uint32 version) |
Static Public Member Functions | |
static World * | get_instance () |
Private Attributes | |
std::vector< Map * > | maps |
CurrentMap * | currentmap |
std::list< ObjId > | ethereal |
Static Private Attributes | |
static World * | world = 0 |
Definition at line 67 of file World.h.
World::World | ( | ) |
World::~World | ( | ) |
void World::clear | ( | ) |
bool World::etherealEmpty | ( | ) | [inline] |
ObjId World::etherealPeek | ( | ) | [inline] |
void World::etherealPush | ( | ObjId | objid | ) | [inline] |
push an item onto the ethereal void
Definition at line 99 of file World.h.
References ethereal.
Referenced by Actor::createActor(), and Item::moveToEtherealVoid().
void World::etherealRemove | ( | ObjId | objid | ) | [inline] |
remove an item from the ethereal void
Definition at line 108 of file World.h.
References ethereal.
Referenced by Item::destroy(), Item::move(), Item::moveToContainer(), and Actor::teleport().
static World* World::get_instance | ( | ) | [inline, static] |
Definition at line 73 of file World.h.
References world.
Referenced by Actor::areEnemiesNear(), Item::ascend(), Item::canExistAt(), Item::canReach(), AnimationTracker::checkWeaponHit(), Item::collideMove(), GameMapGump::ConCmd_dumpMap(), GUIApp::ConCmd_engineStats(), MiniMapGump::ConCmd_generateWholeMap(), Item::countNearby(), Actor::createActor(), Item::destroy(), ActorAnimProcess::doSpecial(), UCMachine::execProcess(), Item::explode(), CameraProcess::FindRoof(), CameraProcess::GetCameraLocation(), CameraProcess::GetLerped(), Actor::giveTreasure(), Item::grab(), MissileTracker::isPathClear(), CameraProcess::ItemMoved(), Item::loadData(), Item::move(), Item::movedByPlayer(), Item::moveToContainer(), Item::moveToEtherealVoid(), GameMapGump::OnMouseClick(), MiniMapGump::PaintThis(), GameMapGump::PaintThis(), FastAreaVisGump::PaintThis(), StartU8Process::run(), QuickAvatarMoverProcess::run(), GravityProcess::run(), GrantPeaceProcess::run(), CombatProcess::seekTarget(), U8Game::startGame(), RemorseGame::startGame(), AnimationTracker::step(), MainActor::teleport(), Actor::teleport(), and Actor::tryAnim().
CurrentMap* World::getCurrentMap | ( | ) | const [inline] |
get the CurrentMap
Definition at line 91 of file World.h.
References currentmap.
Referenced by Actor::areEnemiesNear(), Item::ascend(), Item::canExistAt(), Item::canReach(), AnimationTracker::checkWeaponHit(), Item::collideMove(), GameMapGump::ConCmd_dumpMap(), MiniMapGump::ConCmd_generateWholeMap(), Item::countNearby(), Item::destroy(), ActorAnimProcess::doSpecial(), UCMachine::execProcess(), Item::explode(), CameraProcess::FindRoof(), CameraProcess::GetCameraLocation(), CameraProcess::GetLerped(), Actor::giveTreasure(), Item::grab(), MissileTracker::isPathClear(), CameraProcess::ItemMoved(), Item::loadData(), GUIApp::loadGame(), Item::move(), Item::movedByPlayer(), Item::moveToContainer(), Item::moveToEtherealVoid(), GameMapGump::OnMouseClick(), MiniMapGump::PaintThis(), GameMapGump::PaintThis(), FastAreaVisGump::PaintThis(), StartU8Process::run(), QuickAvatarMoverProcess::run(), GravityProcess::run(), GrantPeaceProcess::run(), GUIApp::saveGame(), CombatProcess::seekTarget(), AnimationTracker::step(), MainActor::teleport(), and Actor::tryAnim().
void World::initMaps | ( | ) |
create (empty) maps, currentmap
Definition at line 92 of file World.cpp.
References currentmap, and maps.
Referenced by reset(), and GUIApp::startupGame().
bool World::load | ( | IDataSource * | ids, | |
uint32 | version | |||
) |
load World data
Definition at line 370 of file World.cpp.
References currentmap, CurrentMap::egghatcher, ethereal, maps, IDataSource::read2(), IDataSource::read4(), and CurrentMap::setMap().
Referenced by GUIApp::loadGame(), and loadMaps().
void World::loadItemCachNPCData | ( | IDataSource * | itemcach, | |
IDataSource * | npcdata | |||
) |
load U8's itemcach.dat, npcdata.dat into the world
Definition at line 216 of file World.cpp.
References ObjectManager::assignActorObjId(), Actor::clearActorFlag(), ItemFactory::createActor(), Item::EXT_PERMANENT_NPC, Item::FLG_IN_NPC_LIST, frame, ObjectManager::get_instance(), ArchiveFile::getDataSource(), pout, IDataSource::read1(), IDataSource::read2(), IDataSource::readX(), IDataSource::seek(), Actor::setActorFlag(), Actor::setAlignment(), Actor::setDex(), Actor::setDir(), Actor::setEnemyAlignment(), Actor::setHP(), Actor::setInt(), Actor::setLastAnim(), Item::setLocation(), Actor::setMana(), Actor::setStr(), Actor::setUnk0C(), IDataSource::skip(), x, and y.
Referenced by U8Game::startGame().
bool World::loadMaps | ( | IDataSource * | ids, | |
uint32 | version | |||
) |
load Maps
Definition at line 394 of file World.cpp.
References load(), maps, and IDataSource::read4().
Referenced by GUIApp::loadGame().
void World::loadNonFixed | ( | IDataSource * | ds | ) |
load U8's nonfixed.dat into the Maps
Definition at line 191 of file World.cpp.
References FlexFile::getCount(), ArchiveFile::getDataSource(), FlexFile::getSize(), maps, and pout.
Referenced by U8Game::startGame().
void World::reset | ( | ) |
reset the world (clear everything and re-initialize maps)
Definition at line 83 of file World.cpp.
References clear(), con, initMaps(), MM_INFO, and Console::Print().
Referenced by GUIApp::resetEngine().
void World::save | ( | ODataSource * | ods | ) |
save the rest of the World data (ethereal items, current map number).
Definition at line 345 of file World.cpp.
References currentmap, CurrentMap::egghatcher, ethereal, CurrentMap::getNum(), ODataSource::write2(), and ODataSource::write4().
Referenced by GUIApp::saveGame(), and saveMaps().
void World::saveMaps | ( | ODataSource * | ods | ) |
save the Maps in World.
Definition at line 385 of file World.cpp.
References maps, save(), and ODataSource::write4().
Referenced by GUIApp::saveGame().
bool World::switchMap | ( | uint32 | newmap | ) |
switch map. This unloads the CurrentMap back into a Map, kills processes, and loads a new Map into the CurrentMap.
Definition at line 105 of file World.cpp.
References Gump::CloseItemDependents(), currentmap, Item::destroy(), ethereal, MemoryManager::freeResources(), RawArchive::get_datasource(), MemoryManager::get_instance(), GameData::get_instance(), Kernel::get_instance(), GUIApp::get_instance(), AudioProcess::get_instance(), GUIApp::getDesktopGump(), GameData::getFixed(), getItem(), CurrentMap::getNum(), Kernel::killProcessesNotOfType(), CurrentMap::loadMap(), maps, perr, pout, CameraProcess::ResetCameraProcess(), CameraProcess::SetCameraProcess(), CameraProcess::SetEarthquake(), AudioProcess::stopAllExceptSpeech(), and CurrentMap::writeback().
Referenced by U8Game::startGame(), RemorseGame::startGame(), and MainActor::teleport().
void World::worldStats | ( | ) |
output some statistics about the world
Definition at line 322 of file World.cpp.
References Item::getLocation(), getMainActor(), Item::getMapNum(), maps, pout, x, and y.
Referenced by GUIApp::ConCmd_engineStats().
CurrentMap* World::currentmap [private] |
Definition at line 129 of file World.h.
Referenced by clear(), getCurrentMap(), initMaps(), load(), save(), and switchMap().
std::list<ObjId> World::ethereal [private] |
Definition at line 131 of file World.h.
Referenced by clear(), etherealEmpty(), etherealPeek(), etherealPush(), etherealRemove(), load(), save(), and switchMap().
std::vector<Map*> World::maps [private] |
Definition at line 128 of file World.h.
Referenced by clear(), initMaps(), load(), loadMaps(), loadNonFixed(), saveMaps(), switchMap(), and worldStats().
World * World::world = 0 [static, private] |