xoreos
0.0.5
|
#include <module.h>
Classes | |
struct | Action |
Public Member Functions | |
Module (::Engines::Console &console) | |
~Module () | |
void | clear () |
Clear the whole context. More... | |
bool | isLoaded () const |
Is a module currently loaded and ready to run? More... | |
bool | isRunning () const |
Is a module currently running? More... | |
void | load (const Common::UString &module) |
Load a module. More... | |
void | usePC (Creature *pc) |
Use this character as the player character. More... | |
void | exit () |
Exit the currently running module. More... | |
const Common::UString & | getName () const |
Return the module's name. More... | |
Area * | getCurrentArea () |
Return the area the PC is currently in. More... | |
Creature * | getPC () |
Return the currently playing PC. More... | |
void | showMenu () |
Show the ingame main menu. More... | |
bool | startConversation (const Common::UString &conv, Creature &pc, Object &obj, bool noWidescreen=false, bool resetZoom=true) |
Start a conversation. More... | |
void | delayScript (const Common::UString &script, const Aurora::NWScript::ScriptState &state, Aurora::NWScript::Object *owner, Aurora::NWScript::Object *triggerer, uint32 delay) |
void | movePC (float x, float y, float z) |
Move the player character to this position within the current area. More... | |
void | movePC (const Common::UString &module) |
Move the player character to this object within this area. More... | |
void | movedPC () |
Notify the module that the PC was moved. More... | |
void | enter () |
Enter the loaded module, starting it. More... | |
void | leave () |
Leave the running module, quitting it. More... | |
void | addEvent (const Events::Event &event) |
Add a single event for consideration into the event queue. More... | |
void | processEventQueue () |
Process the current event queue. More... | |
Public Member Functions inherited from Engines::Jade::ObjectContainer | |
ObjectContainer () | |
~ObjectContainer () | |
void | clearObjects () |
void | addObject (Jade::Object &object) |
Add an object to this container. More... | |
void | removeObject (Jade::Object &object) |
Remove an object from this container. More... | |
::Aurora::NWScript::Object * | getFirstObjectByType (ObjectType type) const |
Return the first object of this type. More... | |
::Aurora::NWScript::ObjectSearch * | findObjectsByType (ObjectType type) const |
Return a search context to iterate over all objects of this type. More... | |
Public Member Functions inherited from Aurora::NWScript::ObjectContainer | |
ObjectContainer () | |
~ObjectContainer () | |
void | clearObjects () |
void | addObject (Object &object) |
Add an object to this container. More... | |
void | removeObject (Object &object) |
Remove an object from this container. More... | |
Object * | getObjectByID (uint32 id) const |
Find a specific object by ID. More... | |
Object * | getFirstObject () const |
Return the first object. More... | |
Object * | getFirstObjectByTag (const Common::UString &tag) const |
Return the first object with this tag. More... | |
ObjectSearch * | findObjects () const |
Return a search context to iterate over all objects. More... | |
ObjectSearch * | findObjectsByTag (const Common::UString &tag) const |
Return a search context to iterate over all objects with this tag. More... | |
Private Types | |
enum | ActionType { kActionNone = 0, kActionScript = 1 } |
typedef std::list< Events::Event > | EventQueue |
typedef std::multiset< Action > | ActionQueue |
Private Member Functions | |
void | unload (bool completeUnload=true) |
Unload the whole shebang. More... | |
void | unloadPC () |
void | unloadArea () |
void | load () |
void | loadArea () |
void | loadModule (const Common::UString &module) |
Load the actual module. More... | |
void | changeModule (const Common::UString &module) |
Schedule a change to a new module. More... | |
void | replaceModule () |
Actually replace the currently running module. More... | |
void | enterArea () |
void | leaveArea () |
void | handleEvents () |
void | handleActions () |
Private Attributes | |
::Engines::Console * | _console |
bool | _hasModule |
Do we have a module? More... | |
bool | _running |
Are we currently running a module? More... | |
std::list< Common::ChangeID > | _resources |
Resources added by the current module. More... | |
Common::ScopedPtr< Creature > | _pc |
The player character we use. More... | |
bool | _exit |
Should we exit the module? More... | |
Common::UString | _module |
The current module's name. More... | |
Common::UString | _newModule |
The module we should change to. More... | |
Common::ScopedPtr< Area > | _area |
The current module's area. More... | |
EventQueue | _eventQueue |
ActionQueue | _delayedActions |
Additional Inherited Members | |
Static Public Member Functions inherited from Engines::Jade::ObjectContainer | |
static Jade::Object * | toObject (::Aurora::NWScript::Object *object) |
static Area * | toArea (Aurora::NWScript::Object *object) |
static Waypoint * | toWaypoint (Aurora::NWScript::Object *object) |
static Placeable * | toPlaceable (Aurora::NWScript::Object *object) |
static Creature * | toCreature (Aurora::NWScript::Object *object) |
static Creature * | toPC (Aurora::NWScript::Object *object) |
static Location * | toLocation (Aurora::NWScript::EngineType *engineType) |
static Event * | toEvent (Aurora::NWScript::EngineType *engineType) |
Protected Member Functions inherited from Aurora::NWScript::ObjectContainer | |
void | lock () |
void | unlock () |
|
private |
|
private |
|
private |
Engines::Jade::Module::Module | ( | ::Engines::Console & | console | ) |
Definition at line 50 of file module.cpp.
Engines::Jade::Module::~Module | ( | ) |
Definition at line 55 of file module.cpp.
References clear().
void Engines::Jade::Module::addEvent | ( | const Events::Event & | event | ) |
Add a single event for consideration into the event queue.
Definition at line 236 of file module.cpp.
References _eventQueue.
|
private |
Schedule a change to a new module.
Definition at line 171 of file module.cpp.
References _newModule, Common::UString::c_str(), getName(), and warning().
Referenced by load().
void Engines::Jade::Module::clear | ( | ) |
Clear the whole context.
Definition at line 62 of file module.cpp.
References unload().
Referenced by ~Module().
void Engines::Jade::Module::delayScript | ( | const Common::UString & | script, |
const Aurora::NWScript::ScriptState & | state, | ||
Aurora::NWScript::Object * | owner, | ||
Aurora::NWScript::Object * | triggerer, | ||
uint32 | delay | ||
) |
Definition at line 342 of file module.cpp.
References _delayedActions, EventMan, kActionScript, Engines::Jade::Module::Action::owner, Engines::Jade::Module::Action::script, Engines::Jade::Module::Action::state, Engines::Jade::Module::Action::timestamp, Engines::Jade::Module::Action::triggerer, and Engines::Jade::Module::Action::type.
Referenced by Engines::Jade::Functions::actionDoCommand(), Engines::Jade::Functions::assignCommand(), and Engines::Jade::Functions::delayCommand().
void Engines::Jade::Module::enter | ( | ) |
Enter the loaded module, starting it.
Definition at line 196 of file module.cpp.
References _area, _console, _exit, _hasModule, _module, _pc, _running, Common::UString::c_str(), CameraMan, enterArea(), and Engines::Console::printf().
Referenced by replaceModule().
|
private |
Definition at line 222 of file module.cpp.
References _area, _pc, and Engines::Jade::kScriptOnEnter.
Referenced by enter().
void Engines::Jade::Module::exit | ( | ) |
Exit the currently running module.
Definition at line 119 of file module.cpp.
References _exit.
Referenced by Engines::Jade::Console::cmdExitModule().
Area * Engines::Jade::Module::getCurrentArea | ( | ) |
Return the area the PC is currently in.
Definition at line 338 of file module.cpp.
References _area.
const Common::UString & Engines::Jade::Module::getName | ( | ) | const |
Return the module's name.
Definition at line 334 of file module.cpp.
References _module.
Referenced by changeModule().
Creature * Engines::Jade::Module::getPC | ( | ) |
Return the currently playing PC.
Definition at line 107 of file module.cpp.
References _pc.
Referenced by Engines::Jade::Area::click(), Engines::Jade::Functions::getPlayer(), and Engines::Jade::Functions::jumpTo().
|
private |
Definition at line 290 of file module.cpp.
References _delayedActions, EventMan, kActionScript, and Engines::Jade::ScriptContainer::runScript().
Referenced by processEventQueue().
|
private |
Definition at line 253 of file module.cpp.
References _area, _console, _eventQueue, CameraMan, FreeRoamCam, Engines::Console::isVisible(), Events::kEventKeyDown, Engines::Console::processEvent(), Engines::Console::show(), and showMenu().
Referenced by processEventQueue().
bool Engines::Jade::Module::isLoaded | ( | ) | const |
Is a module currently loaded and ready to run?
Definition at line 111 of file module.cpp.
References _area, _hasModule, and _pc.
bool Engines::Jade::Module::isRunning | ( | ) | const |
Is a module currently running?
Definition at line 115 of file module.cpp.
References _exit, _running, and EventMan.
Referenced by load(), and processEventQueue().
void Engines::Jade::Module::leave | ( | ) |
Leave the running module, quitting it.
Definition at line 215 of file module.cpp.
References _exit, _running, and leaveArea().
|
private |
Definition at line 228 of file module.cpp.
References _area, _pc, and Engines::Jade::kScriptOnExit.
Referenced by leave(), and unload().
void Engines::Jade::Module::load | ( | const Common::UString & | module | ) |
Load a module.
Definition at line 66 of file module.cpp.
References changeModule(), isRunning(), and loadModule().
Referenced by Engines::Jade::MainMenu::callbackActive(), and Engines::Jade::Console::cmdLoadModule().
|
private |
Definition at line 133 of file module.cpp.
References loadArea().
Referenced by loadModule().
|
private |
Definition at line 137 of file module.cpp.
References _area, and _module.
Referenced by load().
|
private |
Load the actual module.
Definition at line 78 of file module.cpp.
References _hasModule, _module, _newModule, Common::StackException::add(), Common::UString::c_str(), Common::UString::clear(), load(), and unload().
Referenced by load(), movePC(), and replaceModule().
void Engines::Jade::Module::movedPC | ( | ) |
Notify the module that the PC was moved.
Definition at line 322 of file module.cpp.
References _pc, and CameraMan.
Referenced by Engines::Jade::Functions::jumpTo(), and movePC().
void Engines::Jade::Module::movePC | ( | float | x, |
float | y, | ||
float | z | ||
) |
Move the player character to this position within the current area.
Definition at line 307 of file module.cpp.
References _pc, and movedPC().
void Engines::Jade::Module::movePC | ( | const Common::UString & | module | ) |
Move the player character to this object within this area.
Definition at line 315 of file module.cpp.
References _module, Common::UString::empty(), and loadModule().
void Engines::Jade::Module::processEventQueue | ( | ) |
Process the current event queue.
Definition at line 240 of file module.cpp.
References handleActions(), handleEvents(), isRunning(), and replaceModule().
|
private |
Actually replace the currently running module.
Definition at line 180 of file module.cpp.
References _console, _exit, _newModule, Common::UString::empty(), enter(), Engines::Console::hide(), loadModule(), and unload().
Referenced by processEventQueue().
void Engines::Jade::Module::showMenu | ( | ) |
Show the ingame main menu.
Definition at line 123 of file module.cpp.
Referenced by handleEvents().
bool Engines::Jade::Module::startConversation | ( | const Common::UString & | conv, |
Creature & | pc, | ||
Object & | obj, | ||
bool | noWidescreen = false , |
||
bool | resetZoom = true |
||
) |
Start a conversation.
conv | The dialog ResRef to use. |
pc | The PC that initiated the conversation. |
obj | The object the PC is talking with. |
noWidescreen | True to start with short bars, false to start with tall bars |
resetZoom | Whether to set the zoom back to standard when starting the conversation |
Definition at line 127 of file module.cpp.
Referenced by Engines::Jade::Functions::actionStartConversation().
|
private |
Unload the whole shebang.
completeUnload | Also unload the PC. true: completely quit the module false: the PC can be transferred to a new module. |
Definition at line 141 of file module.cpp.
References _delayedActions, _eventQueue, _hasModule, _module, _newModule, Common::UString::clear(), leaveArea(), unloadArea(), and unloadPC().
Referenced by clear(), loadModule(), and replaceModule().
|
private |
Definition at line 158 of file module.cpp.
References _area.
Referenced by unload().
|
private |
Definition at line 162 of file module.cpp.
References _pc, and Engines::Jade::ObjectContainer::removeObject().
Referenced by unload(), and usePC().
void Engines::Jade::Module::usePC | ( | Creature * | pc | ) |
Use this character as the player character.
Definition at line 99 of file module.cpp.
References _pc, Engines::Jade::ObjectContainer::addObject(), and unloadPC().
|
private |
The current module's area.
Definition at line 171 of file module.h.
Referenced by enter(), enterArea(), getCurrentArea(), handleEvents(), isLoaded(), leaveArea(), loadArea(), and unloadArea().
|
private |
Definition at line 156 of file module.h.
Referenced by enter(), handleEvents(), and replaceModule().
|
private |
Definition at line 174 of file module.h.
Referenced by delayScript(), handleActions(), and unload().
|
private |
Definition at line 173 of file module.h.
Referenced by addEvent(), handleEvents(), and unload().
|
private |
Should we exit the module?
Definition at line 166 of file module.h.
Referenced by enter(), exit(), isRunning(), leave(), and replaceModule().
|
private |
Do we have a module?
Definition at line 158 of file module.h.
Referenced by enter(), isLoaded(), loadModule(), and unload().
|
private |
The current module's name.
Definition at line 168 of file module.h.
Referenced by enter(), getName(), loadArea(), loadModule(), movePC(), and unload().
|
private |
The module we should change to.
Definition at line 169 of file module.h.
Referenced by changeModule(), loadModule(), replaceModule(), and unload().
|
private |
The player character we use.
Definition at line 164 of file module.h.
Referenced by enter(), enterArea(), getPC(), isLoaded(), leaveArea(), movedPC(), movePC(), unloadPC(), and usePC().
|
private |
|
private |
Are we currently running a module?
Definition at line 159 of file module.h.
Referenced by enter(), isRunning(), and leave().