xoreos
0.0.5
|
#include <campaign.h>
Classes | |
struct | RIMNode |
A node in the RIM tree. More... | |
Public Member Functions | |
const Common::UString & | getUID () const |
Return the unique ID of this campaign. More... | |
const Aurora::LocString & | getName () const |
const Aurora::LocString & | getDescription () const |
const Common::UString & | getExtendsUID () const |
Return the UID of the campaign this campaign/content extends, if any. More... | |
bool | isEnabled () const |
Is this Campaign enabled? More... | |
bool | isBioWare () const |
Is this an original campaign by BioWare? More... | |
bool | needsAuth () const |
Does this campaign need authorization from BioWare? More... | |
const Common::UString & | getAreaRIM (const Common::UString &area) const |
Return the RIM file containing this area. More... | |
const std::vector< Common::UString > & | getAreas () const |
Area * | getCurrentArea () const |
Return the area the PC is currently in. More... | |
Creature * | getPC () const |
Return the currently playing PC. More... | |
bool | isLoaded () const |
Is this campaign currently loaded? More... | |
void | movePC (const Common::UString &area) |
Move the player character to this area. More... | |
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 &area, float x, float y, float z) |
Move the player character to this position within this area. More... | |
Public Member Functions inherited from Engines::DragonAge2::Object | |
Object (ObjectType type=kObjectTypeInvalid) | |
virtual | ~Object () |
ObjectType | getType () const |
Return the exact type of the object. More... | |
virtual void | show () |
Show the object's model(s). More... | |
virtual void | hide () |
Hide the object's model(s). More... | |
const std::list< uint32 > & | getIDs () const |
Return the object's model IDs. More... | |
const Common::UString & | getResRef () const |
Return the object's resource reference. More... | |
const Aurora::LocString & | getName () const |
Return the object's name. More... | |
const Aurora::LocString & | getDescription () const |
Return the object's description. More... | |
const Common::UString & | getConversation () const |
Return the object's default conversation (DLG). More... | |
const Common::UString & | getNonLocalizedName () const |
Return the object's non-localized name. More... | |
void | setNonLocalizedName (const Common::UString &name) |
Set the object's non-localized name. More... | |
bool | isStatic () const |
Is the object static (not manipulable at all)? More... | |
bool | isUsable () const |
Can the object be used by the PC? More... | |
bool | isClickable () const |
Can the player click the object? More... | |
virtual void | getPosition (float &x, float &y, float &z) const |
Return the object's position within its area. More... | |
virtual void | getOrientation (float &x, float &y, float &z, float &angle) const |
Return the object's orientation. More... | |
virtual void | setPosition (float x, float y, float z) |
Set the object's position within its area. More... | |
virtual void | setOrientation (float x, float y, float z, float angle) |
Set the object's orientation. More... | |
virtual void | enter () |
The cursor entered the object. More... | |
virtual void | highlight (bool enabled) |
(Un)Highlight the object. More... | |
virtual bool | click (Object *triggerer=0) |
The object was clicked. More... | |
Public Member Functions inherited from Aurora::NWScript::Object | |
Object () | |
uint32 | getID () const |
const Common::UString & | getTag () const |
Public Member Functions inherited from Aurora::NWScript::VariableContainer | |
VariableContainer () | |
virtual | ~VariableContainer () |
bool | hasVariable (const Common::UString &var) const |
Variable & | getVariable (const Common::UString &var, Type type=kTypeVoid) |
const Variable & | getVariable (const Common::UString &var) const |
void | setVariable (const Common::UString &var, const Variable &value) |
void | removeVariable (const Common::UString &var) |
void | clearVariables () |
Public Member Functions inherited from Engines::DragonAge2::ScriptContainer | |
ScriptContainer () | |
~ScriptContainer () | |
const Common::UString & | getScript () const |
bool | hasScript () const |
void | enableEvent (EventType event, bool enabled) |
Enable/Disable the handling of a specific event. More... | |
void | enableEvents (bool enabled) |
Enable/Disable the handling of all events. More... | |
bool | runScript (EventType event, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference()) |
bool | runScript (Event &event) |
Public Member Functions inherited from Engines::DragonAge2::ObjectContainer | |
ObjectContainer () | |
~ObjectContainer () | |
void | clearObjects () |
void | addObject (DragonAge2::Object &object) |
Add an object to this container. More... | |
void | removeObject (DragonAge2::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 | |
typedef std::map< Common::UString, const RIMNode * > | AreaMap |
Map of area RIMNodes indexed by the area resref. More... | |
typedef std::list< Events::Event > | EventQueue |
Private Member Functions | |
Campaign (Game &game, const Common::UString &cifPath="", const Common::UString &manifestPath="", const Common::UString &addinBase="") | |
~Campaign () | |
void | read (const Common::UString &cifPath, const Common::UString &manifestPath) |
void | readCIFStatic (const Common::UString &path) |
RIMNode * | readRIMs (const Aurora::GFF4Struct &node, const RIMNode *parent=0) |
void | readManifest (const Common::UString &path) |
void | addAreaName (const RIMNode &node) |
void | readCIFDynamic (const Common::UString &path) |
void | loadResources () |
void | load () |
Load the campaign for playing. More... | |
void | unload () |
Unload the campaign after playing. More... | |
void | enter (Creature &pc) |
Enter the campaign, starting it. More... | |
void | leave () |
Leave the campaign, ending it. More... | |
void | addEvent (const Events::Event &event) |
Add a single event for consideration into the area event queue. More... | |
void | processEventQueue () |
Process the current event queue. More... | |
void | loadArea () |
void | unloadArea () |
bool | changeArea () |
void | enterArea (bool startArea=false) |
void | leaveArea () |
void | handleEvents () |
Private Attributes | |
Game * | _game |
Common::UString | _uid |
Common::UString | _cifPath |
Common::UString | _addinBase |
Aurora::LocString | _name |
Aurora::LocString | _description |
Common::UString | _extends |
bool | _enabled |
bool | _bioware |
bool | _needsAuth |
uint32 | _priority |
uint32 | _format |
uint32 | _state |
Common::UString | _entryArea |
Common::UString | _entryAreaList |
Common::UString | _entryScript |
Common::UString | _entryClientScript |
float | _entryPosition [3] |
float | _entryOrientation [3] |
std::vector< Common::UString > | _packages |
Common::ScopedPtr< RIMNode > | _rimRoot |
AreaMap | _areaMap |
std::vector< Common::UString > | _areas |
bool | _loaded |
ChangeList | _resources |
ChangeList | _tlks |
Creature * | _pc |
The player character we use. More... | |
Common::UString | _newArea |
The new area to enter. More... | |
Common::ScopedPtr< Area > | _currentArea |
The current area. More... | |
EventQueue | _eventQueue |
Friends | |
class | Campaigns |
template<typename T > | |
void | Common::DeallocatorDefault::destroy (T *) |
Definition at line 54 of file campaign.h.
|
private |
Map of area RIMNodes indexed by the area resref.
Definition at line 117 of file campaign.h.
|
private |
Definition at line 119 of file campaign.h.
|
private |
Definition at line 61 of file campaign.cpp.
References _entryOrientation, _entryPosition, and read().
|
private |
Definition at line 79 of file campaign.cpp.
References unload().
|
private |
|
private |
Add a single event for consideration into the area event queue.
Definition at line 483 of file campaign.cpp.
References _eventQueue.
Referenced by Engines::DragonAge2::Campaigns::handleEvents().
|
private |
Definition at line 471 of file campaign.cpp.
References _currentArea, _newArea, enterArea(), and loadArea().
Referenced by processEventQueue().
|
private |
Enter the campaign, starting it.
Definition at line 418 of file campaign.cpp.
References _pc, enterArea(), isLoaded(), Engines::DragonAge2::kEventTypeEnter, Engines::DragonAge2::kEventTypeGameObjectsLoaded, Engines::DragonAge2::kEventTypeModuleStart, and Engines::DragonAge2::ScriptContainer::runScript().
Referenced by Engines::DragonAge2::Campaigns::enter().
|
private |
Definition at line 376 of file campaign.cpp.
References _currentArea, _entryOrientation, _entryPosition, _eventQueue, _pc, CameraMan, Engines::DragonAge2::kEventTypeAreaLoadPostLoadExit, Engines::DragonAge2::kEventTypeAreaLoadPreLoadExit, Engines::DragonAge2::kEventTypeAreaLoadSpecial, Engines::DragonAge2::kEventTypeEnter, and status().
Referenced by changeArea(), and enter().
const Common::UString & Engines::DragonAge2::Campaign::getAreaRIM | ( | const Common::UString & | area | ) | const |
Return the RIM file containing this area.
Definition at line 278 of file campaign.cpp.
References _areaMap, and Aurora::kEmptyString.
Referenced by Engines::DragonAge2::Console::cmdListAreas().
const std::vector< Common::UString > & Engines::DragonAge2::Campaign::getAreas | ( | ) | const |
Definition at line 288 of file campaign.cpp.
References _areas.
Referenced by Engines::DragonAge2::Console::cmdListAreas(), Engines::DragonAge2::Console::cmdLoadArea(), and Engines::DragonAge2::Console::updateAreas().
Area * Engines::DragonAge2::Campaign::getCurrentArea | ( | ) | const |
Return the area the PC is currently in.
Definition at line 292 of file campaign.cpp.
References _currentArea.
Referenced by Engines::DragonAge2::Functions::getArea().
const Aurora::LocString & Engines::DragonAge2::Campaign::getDescription | ( | ) | const |
Definition at line 94 of file campaign.cpp.
References _description.
const Common::UString & Engines::DragonAge2::Campaign::getExtendsUID | ( | ) | const |
Return the UID of the campaign this campaign/content extends, if any.
Definition at line 98 of file campaign.cpp.
References _extends.
Referenced by Engines::DragonAge2::Campaigns::addCampaign().
const Aurora::LocString & Engines::DragonAge2::Campaign::getName | ( | ) | const |
Definition at line 90 of file campaign.cpp.
References _name.
Referenced by Engines::DragonAge2::Campaigns::loadCampaign().
Creature * Engines::DragonAge2::Campaign::getPC | ( | ) | const |
Return the currently playing PC.
Definition at line 296 of file campaign.cpp.
References _pc.
Referenced by Engines::DragonAge2::Area::click(), Engines::DragonAge2::Functions::getHero(), and Engines::DragonAge2::Functions::isHero().
const Common::UString & Engines::DragonAge2::Campaign::getUID | ( | ) | const |
Return the unique ID of this campaign.
Definition at line 86 of file campaign.cpp.
References _uid.
Referenced by Engines::DragonAge2::Campaigns::addCampaign(), Engines::DragonAge2::Campaigns::changeCampaign(), and Engines::DragonAge2::Campaigns::loadCampaign().
|
private |
Definition at line 499 of file campaign.cpp.
References _currentArea, and _eventQueue.
Referenced by processEventQueue().
bool Engines::DragonAge2::Campaign::isBioWare | ( | ) | const |
Is this an original campaign by BioWare?
Definition at line 270 of file campaign.cpp.
References _bioware.
bool Engines::DragonAge2::Campaign::isEnabled | ( | ) | const |
Is this Campaign enabled?
Definition at line 266 of file campaign.cpp.
References _enabled.
Referenced by Engines::DragonAge2::Campaigns::addCampaign().
bool Engines::DragonAge2::Campaign::isLoaded | ( | ) | const |
Is this campaign currently loaded?
Definition at line 300 of file campaign.cpp.
References _loaded.
Referenced by enter(), Engines::DragonAge2::Campaigns::isLoaded(), Engines::DragonAge2::Campaigns::isRunning(), and processEventQueue().
|
privatevirtual |
Leave the campaign, ending it.
Reimplemented from Engines::DragonAge2::Object.
Definition at line 432 of file campaign.cpp.
References _pc, Engines::DragonAge2::kEventTypeExit, leaveArea(), and Engines::DragonAge2::ScriptContainer::runScript().
Referenced by Engines::DragonAge2::Campaigns::leave(), and unload().
|
private |
Definition at line 441 of file campaign.cpp.
References _currentArea, _pc, and Engines::DragonAge2::kEventTypeExit.
Referenced by leave(), and unloadArea().
|
private |
Load the campaign for playing.
Definition at line 345 of file campaign.cpp.
References _cifPath, _entryArea, _loaded, _name, _newArea, Aurora::NWScript::Object::_tag, _uid, Common::UString::c_str(), Aurora::LocString::getString(), loadArea(), loadResources(), readCIFDynamic(), and status().
Referenced by Engines::DragonAge2::Campaigns::loadCampaign().
|
private |
Definition at line 459 of file campaign.cpp.
References _areaMap, _currentArea, _newArea, Common::UString::c_str(), Common::UString::empty(), and unloadArea().
Referenced by changeArea(), and load().
|
private |
Definition at line 304 of file campaign.cpp.
References _addinBase, _game, _packages, _resources, _tlks, Common::UString::empty(), Engines::DragonAge2::kTextureQualityHigh, Engines::DragonAge2::Game::loadResources(), Engines::DragonAge2::Game::loadTalkTables(), and Engines::DragonAge2::Game::loadTexturePack().
Referenced by load().
void Engines::DragonAge2::Campaign::movePC | ( | const Common::UString & | area | ) |
Move the player character to this area.
Definition at line 508 of file campaign.cpp.
References _newArea.
Referenced by Engines::DragonAge2::Console::cmdLoadArea(), Engines::DragonAge2::Functions::doAreaTransition(), and movePC().
void Engines::DragonAge2::Campaign::movePC | ( | float | x, |
float | y, | ||
float | z | ||
) |
Move the player character to this position within the current area.
Definition at line 512 of file campaign.cpp.
References _pc, CameraMan, and Engines::DragonAge2::Creature::setPosition().
void Engines::DragonAge2::Campaign::movePC | ( | const Common::UString & | area, |
float | x, | ||
float | y, | ||
float | z | ||
) |
Move the player character to this position within this area.
Definition at line 521 of file campaign.cpp.
References movePC().
bool Engines::DragonAge2::Campaign::needsAuth | ( | ) | const |
Does this campaign need authorization from BioWare?
Definition at line 274 of file campaign.cpp.
References _needsAuth.
|
private |
Process the current event queue.
Definition at line 487 of file campaign.cpp.
References changeArea(), handleEvents(), and isLoaded().
Referenced by Engines::DragonAge2::Campaigns::handleEvents().
|
private |
Definition at line 102 of file campaign.cpp.
References _enabled, _entryArea, _extends, _format, _needsAuth, _state, _uid, Common::UString::empty(), Common::FilePath::getStem(), readCIFStatic(), and readManifest().
Referenced by Campaign().
|
private |
Definition at line 327 of file campaign.cpp.
References _rimRoot, Common::debugTag(), Engines::DragonAge2::ScriptContainer::enableEvents(), Engines::DragonAge2::kCIFID, Aurora::GFF4FieldNamesEnum::kGFF4RimTreeRootNode, Engines::DragonAge2::kVersion01, readRIMs(), Engines::DragonAge2::ScriptContainer::readScript(), and Engines::DragonAge2::Object::readVarTable().
Referenced by load().
|
private |
Definition at line 139 of file campaign.cpp.
References _description, _entryArea, _entryAreaList, _entryClientScript, _entryOrientation, _entryPosition, _entryScript, _name, _packages, Common::debugTag(), Engines::DragonAge2::kCIFID, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFDescriptionCSCZ, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFDescriptionDEDE, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFDescriptionENUS, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFDescriptionESES, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFDescriptionFRFR, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFDescriptionHUHU, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFDescriptionITIT, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFDescriptionPLPL, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFDescriptionRURU, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFDisplayNameCSCZ, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFDisplayNameDEDE, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFDisplayNameENUS, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFDisplayNameESES, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFDisplayNameFRFR, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFDisplayNameHUHU, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFDisplayNameITIT, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFDisplayNamePLPL, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFDisplayNameRURU, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFEntryArea, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFEntryAreaList, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFEntryClientScript, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFEntryOrientation, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFEntryPosition, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFEntryScript, Aurora::GFF4FieldNamesEnum::kGFF4CampaignCIFPackagesList, Aurora::kLanguageCzech, Aurora::kLanguageEnglish, Aurora::kLanguageFrench, Aurora::kLanguageGerman, Aurora::kLanguageHungarian, Aurora::kLanguageItalian, Aurora::kLanguagePolish, Aurora::kLanguageRussian, Aurora::kLanguageSpanish, Engines::DragonAge2::kVersion01, and Aurora::LocString::setString().
Referenced by read().
|
private |
Definition at line 220 of file campaign.cpp.
References _bioware, _enabled, _extends, _format, _needsAuth, _priority, _state, Aurora::NWScript::Object::_tag, _uid, Common::UString::c_str(), Common::UString::empty(), Common::XMLNode::findChild(), Common::XMLNode::getName(), Common::XMLNode::getProperty(), Common::XMLParser::getRoot(), and Common::parseString().
Referenced by read().
|
private |
|
private |
Unload the campaign after playing.
Definition at line 357 of file campaign.cpp.
References _areaMap, _areas, _currentArea, _game, _loaded, _resources, _rimRoot, _tlks, Engines::DragonAge2::ObjectContainer::clearObjects(), Engines::deindexResources(), leave(), TwoDAReg, and Engines::DragonAge2::Game::unloadTalkTables().
Referenced by Engines::DragonAge2::Campaigns::clean(), Engines::DragonAge2::Campaigns::unload(), and ~Campaign().
|
private |
Definition at line 451 of file campaign.cpp.
References _currentArea, Engines::DragonAge2::ObjectContainer::clearObjects(), and leaveArea().
Referenced by loadArea().
|
friend |
Definition at line 213 of file campaign.h.
|
friend |
|
private |
Definition at line 127 of file campaign.h.
Referenced by loadResources().
|
private |
Definition at line 153 of file campaign.h.
Referenced by getAreaRIM(), loadArea(), and unload().
|
private |
Definition at line 155 of file campaign.h.
Referenced by getAreas(), and unload().
|
private |
Definition at line 135 of file campaign.h.
Referenced by isBioWare(), and readManifest().
|
private |
Definition at line 126 of file campaign.h.
Referenced by load().
|
private |
The current area.
Definition at line 166 of file campaign.h.
Referenced by changeArea(), enterArea(), getCurrentArea(), handleEvents(), leaveArea(), loadArea(), unload(), and unloadArea().
|
private |
Definition at line 130 of file campaign.h.
Referenced by getDescription(), and readCIFStatic().
|
private |
Definition at line 134 of file campaign.h.
Referenced by isEnabled(), read(), and readManifest().
|
private |
Definition at line 142 of file campaign.h.
Referenced by load(), read(), and readCIFStatic().
|
private |
Definition at line 143 of file campaign.h.
Referenced by readCIFStatic().
|
private |
Definition at line 145 of file campaign.h.
Referenced by readCIFStatic().
|
private |
Definition at line 148 of file campaign.h.
Referenced by Campaign(), enterArea(), and readCIFStatic().
|
private |
Definition at line 147 of file campaign.h.
Referenced by Campaign(), enterArea(), and readCIFStatic().
|
private |
Definition at line 144 of file campaign.h.
Referenced by readCIFStatic().
|
private |
Definition at line 168 of file campaign.h.
Referenced by addEvent(), enterArea(), and handleEvents().
|
private |
Definition at line 132 of file campaign.h.
Referenced by getExtendsUID(), read(), and readManifest().
|
private |
Definition at line 139 of file campaign.h.
Referenced by read(), and readManifest().
|
private |
Definition at line 122 of file campaign.h.
Referenced by loadResources(), and unload().
|
private |
Definition at line 157 of file campaign.h.
Referenced by isLoaded(), load(), and unload().
|
private |
Definition at line 129 of file campaign.h.
Referenced by getName(), load(), and readCIFStatic().
|
private |
Definition at line 136 of file campaign.h.
Referenced by needsAuth(), read(), and readManifest().
|
private |
The new area to enter.
Definition at line 165 of file campaign.h.
Referenced by changeArea(), load(), loadArea(), and movePC().
|
private |
Definition at line 150 of file campaign.h.
Referenced by loadResources(), and readCIFStatic().
|
private |
The player character we use.
Definition at line 163 of file campaign.h.
Referenced by enter(), enterArea(), getPC(), leave(), leaveArea(), and movePC().
|
private |
Definition at line 138 of file campaign.h.
Referenced by readManifest().
|
private |
Definition at line 159 of file campaign.h.
Referenced by loadResources(), and unload().
|
private |
Definition at line 152 of file campaign.h.
Referenced by readCIFDynamic(), and unload().
|
private |
Definition at line 140 of file campaign.h.
Referenced by read(), and readManifest().
|
private |
Definition at line 160 of file campaign.h.
Referenced by loadResources(), and unload().
|
private |
Definition at line 124 of file campaign.h.
Referenced by getUID(), load(), read(), and readManifest().