xoreos
0.0.5
|
#include <campaigns.h>
Public Types | |
typedef Common::PtrVector< Campaign > | PlayableCampaigns |
typedef Common::PtrVector< Campaign > | AddinContent |
Public Member Functions | |
Campaigns (::Engines::Console &console, Game &game) | |
~Campaigns () | |
const PlayableCampaigns & | getCampaigns () const |
Return all playable campaigns. More... | |
const AddinContent & | getAddins () const |
Return all add-in content for other campaigns. More... | |
const Campaign * | findCampaign (const Common::UString &uid) const |
Find a specific campaign by UID and return it, or 0 if not found. More... | |
const Campaign * | findAddin (const Common::UString &uid) const |
Find a specific add-in by UID and return it, or 0 if not found. More... | |
bool | isLoaded () const |
Is a campaign currently loaded and ready to run? More... | |
bool | isRunning () const |
Is a campaign currently running? More... | |
void | load (const Campaign &campaign) |
Load a campaign. More... | |
void | usePC (Creature *pc) |
Use this character as the player character. More... | |
void | exit () |
Exit the currently running campaign. More... | |
void | unload () |
Completely unload the currently loaded campaign. More... | |
Campaign * | getCurrentCampaign () const |
Return the currently running campaign. More... | |
Creature * | getPC () const |
Return the currently playing PC. More... | |
void | refreshLocalized () |
Refresh all localized strings. More... | |
void | enter () |
Enter the loaded campaign, starting it. More... | |
void | leave () |
Leave the running campaign, 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... | |
Private Types | |
typedef std::list< Events::Event > | EventQueue |
Private Member Functions | |
void | clean () |
void | unload (bool completeUnload) |
Unload the whole shebang. More... | |
void | unloadPC () |
void | loadCampaign (const Campaign &campaign) |
Load a new campaign. More... | |
void | changeCampaign (const Campaign &campaign) |
Schedule a change to a new campaign. More... | |
void | replaceCampaign () |
Actually replace the currently running campaign. More... | |
void | findCampaigns () |
void | addCampaign (Campaign *campaign) |
Campaign * | readCampaign (const Common::UString &cifPath="", const Common::UString &manifestPath="", const Common::UString &addinBase="") |
Campaign * | getCampaign (const Common::UString &uid) |
Campaign * | getAddin (const Common::UString &uid) |
void | handleEvents () |
Private Attributes | |
::Engines::Console * | _console |
Game * | _game |
bool | _hasCampaign |
Do we have a campaign? More... | |
bool | _running |
Are we currently running a campaign? More... | |
bool | _exit |
Should we exit the campaign? More... | |
PlayableCampaigns | _campaigns |
All campaigns we know about. More... | |
AddinContent | _addins |
All add-in content we know about. More... | |
Campaign * | _currentCampaign |
The currently loaded campaign. More... | |
Common::ScopedPtr< Creature > | _pc |
The player character we use. More... | |
Common::UString | _newCampaign |
The UID of the campaign we should change to. More... | |
EventQueue | _eventQueue |
Definition at line 47 of file campaigns.h.
Definition at line 54 of file campaigns.h.
|
private |
Definition at line 108 of file campaigns.h.
Definition at line 53 of file campaigns.h.
Engines::DragonAge2::Campaigns::Campaigns | ( | ::Engines::Console & | console, |
Game & | game | ||
) |
Definition at line 47 of file campaigns.cpp.
References findCampaigns().
Engines::DragonAge2::Campaigns::~Campaigns | ( | ) |
Definition at line 53 of file campaigns.cpp.
References clean().
|
private |
Definition at line 144 of file campaigns.cpp.
References _addins, _campaigns, Common::UString::empty(), Engines::DragonAge2::Campaign::getExtendsUID(), Engines::DragonAge2::Campaign::getUID(), and Engines::DragonAge2::Campaign::isEnabled().
Referenced by findCampaigns().
void Engines::DragonAge2::Campaigns::addEvent | ( | const Events::Event & | event | ) |
Add a single event for consideration into the event queue.
Definition at line 263 of file campaigns.cpp.
References _eventQueue.
|
private |
Schedule a change to a new campaign.
Definition at line 319 of file campaigns.cpp.
References _newCampaign, and Engines::DragonAge2::Campaign::getUID().
Referenced by load().
|
private |
Definition at line 60 of file campaigns.cpp.
References _currentCampaign, and Engines::DragonAge2::Campaign::unload().
Referenced by ~Campaigns().
void Engines::DragonAge2::Campaigns::enter | ( | ) |
Enter the loaded campaign, starting it.
Definition at line 242 of file campaigns.cpp.
References _currentCampaign, _exit, _hasCampaign, _pc, _running, and Engines::DragonAge2::Campaign::enter().
Referenced by replaceCampaign().
void Engines::DragonAge2::Campaigns::exit | ( | ) |
Exit the currently running campaign.
Definition at line 187 of file campaigns.cpp.
References _exit.
const Campaign * Engines::DragonAge2::Campaigns::findAddin | ( | const Common::UString & | uid | ) | const |
Find a specific add-in by UID and return it, or 0 if not found.
Definition at line 81 of file campaigns.cpp.
References _addins.
const Campaign * Engines::DragonAge2::Campaigns::findCampaign | ( | const Common::UString & | uid | ) | const |
Find a specific campaign by UID and return it, or 0 if not found.
Definition at line 73 of file campaigns.cpp.
References _campaigns.
|
private |
Definition at line 113 of file campaigns.cpp.
References addCampaign(), Common::FileList::findFirst(), Common::FileList::findFirstGlob(), Common::FilePath::findSubDirectory(), Common::FilePath::getSubDirectories(), readCampaign(), Common::FilePath::relativize(), ResMan, and status().
Referenced by Campaigns().
|
private |
Definition at line 97 of file campaigns.cpp.
References _addins.
const Campaigns::AddinContent & Engines::DragonAge2::Campaigns::getAddins | ( | ) | const |
Return all add-in content for other campaigns.
Definition at line 69 of file campaigns.cpp.
References _addins.
|
private |
Definition at line 89 of file campaigns.cpp.
References _campaigns.
Referenced by loadCampaign(), and replaceCampaign().
const Campaigns::PlayableCampaigns & Engines::DragonAge2::Campaigns::getCampaigns | ( | ) | const |
Return all playable campaigns.
Definition at line 65 of file campaigns.cpp.
References _campaigns.
Referenced by Engines::DragonAge2::Console::cmdListCampaigns(), Engines::DragonAge2::Console::cmdLoadCampaign(), and Engines::DragonAge2::Console::updateCampaigns().
Campaign * Engines::DragonAge2::Campaigns::getCurrentCampaign | ( | ) | const |
Return the currently running campaign.
Definition at line 311 of file campaigns.cpp.
References _currentCampaign.
Referenced by Engines::DragonAge2::Console::cmdListAreas(), Engines::DragonAge2::Console::cmdLoadArea(), Engines::DragonAge2::Functions::doAreaTransition(), Engines::DragonAge2::Functions::getArea(), Engines::DragonAge2::Functions::getHero(), Engines::DragonAge2::Functions::getModule(), Engines::DragonAge2::Functions::getNearestObject(), Engines::DragonAge2::Functions::getNearestObjectByTag(), Engines::DragonAge2::Functions::getObjectByTag(), Engines::DragonAge2::Functions::isHero(), Engines::DragonAge2::Console::updateAreas(), and Engines::DragonAge2::Functions::UT_getNearestObjectByTag().
Creature * Engines::DragonAge2::Campaigns::getPC | ( | ) | const |
|
private |
Definition at line 279 of file campaigns.cpp.
References _console, _currentCampaign, _eventQueue, Engines::DragonAge2::Campaign::addEvent(), CameraMan, FreeRoamCam, Engines::Console::isVisible(), Events::kEventKeyDown, Engines::Console::processEvent(), Engines::DragonAge2::Campaign::processEventQueue(), and Engines::Console::show().
Referenced by processEventQueue().
bool Engines::DragonAge2::Campaigns::isLoaded | ( | ) | const |
Is a campaign currently loaded and ready to run?
Definition at line 105 of file campaigns.cpp.
References _currentCampaign, _hasCampaign, and Engines::DragonAge2::Campaign::isLoaded().
bool Engines::DragonAge2::Campaigns::isRunning | ( | ) | const |
Is a campaign currently running?
Definition at line 109 of file campaigns.cpp.
References _currentCampaign, _exit, _running, EventMan, and Engines::DragonAge2::Campaign::isLoaded().
Referenced by load(), and processEventQueue().
void Engines::DragonAge2::Campaigns::leave | ( | ) |
Leave the running campaign, quitting it.
Definition at line 255 of file campaigns.cpp.
References _currentCampaign, _exit, _running, and Engines::DragonAge2::Campaign::leave().
void Engines::DragonAge2::Campaigns::load | ( | const Campaign & | campaign | ) |
Load a campaign.
Definition at line 175 of file campaigns.cpp.
References changeCampaign(), isRunning(), and loadCampaign().
Referenced by Engines::DragonAge2::Console::cmdLoadCampaign().
|
private |
Load a new campaign.
Definition at line 217 of file campaigns.cpp.
References _currentCampaign, _hasCampaign, Common::StackException::add(), Common::UString::c_str(), getCampaign(), Engines::DragonAge2::Campaign::getName(), Aurora::LocString::getString(), Engines::DragonAge2::Campaign::getUID(), Engines::DragonAge2::Campaign::load(), and unload().
Referenced by load(), and replaceCampaign().
void Engines::DragonAge2::Campaigns::processEventQueue | ( | ) |
Process the current event queue.
Definition at line 267 of file campaigns.cpp.
References handleEvents(), isRunning(), and replaceCampaign().
|
private |
Definition at line 156 of file campaigns.cpp.
References _game, Common::UString::empty(), Common::exceptionDispatcherWarning(), and Common::FilePath::getStem().
Referenced by findCampaigns().
void Engines::DragonAge2::Campaigns::refreshLocalized | ( | ) |
Refresh all localized strings.
Definition at line 337 of file campaigns.cpp.
|
private |
Actually replace the currently running campaign.
Definition at line 323 of file campaigns.cpp.
References _newCampaign, Common::UString::clear(), Common::UString::empty(), enter(), getCampaign(), and loadCampaign().
Referenced by processEventQueue().
void Engines::DragonAge2::Campaigns::unload | ( | ) |
Completely unload the currently loaded campaign.
Definition at line 191 of file campaigns.cpp.
Referenced by loadCampaign().
|
private |
Unload the whole shebang.
completeUnload | Also unload the PC true: completely quit the current campaign. false: the PC can be transferred to a new campaign. |
Definition at line 195 of file campaigns.cpp.
References _currentCampaign, _eventQueue, _exit, _hasCampaign, _newCampaign, _running, Common::UString::clear(), Engines::DragonAge2::Campaign::unload(), and unloadPC().
|
private |
Definition at line 213 of file campaigns.cpp.
References _pc.
Referenced by unload().
void Engines::DragonAge2::Campaigns::usePC | ( | Creature * | pc | ) |
Use this character as the player character.
Definition at line 238 of file campaigns.cpp.
References _pc.
|
private |
All add-in content we know about.
Definition at line 121 of file campaigns.h.
Referenced by addCampaign(), findAddin(), getAddin(), and getAddins().
|
private |
All campaigns we know about.
Definition at line 119 of file campaigns.h.
Referenced by addCampaign(), findCampaign(), getCampaign(), and getCampaigns().
|
private |
Definition at line 111 of file campaigns.h.
Referenced by handleEvents().
|
private |
The currently loaded campaign.
Definition at line 124 of file campaigns.h.
Referenced by clean(), enter(), getCurrentCampaign(), handleEvents(), isLoaded(), isRunning(), leave(), loadCampaign(), and unload().
|
private |
Definition at line 132 of file campaigns.h.
Referenced by addEvent(), handleEvents(), and unload().
|
private |
Should we exit the campaign?
Definition at line 116 of file campaigns.h.
Referenced by enter(), exit(), isRunning(), leave(), and unload().
|
private |
Definition at line 112 of file campaigns.h.
Referenced by readCampaign().
|
private |
Do we have a campaign?
Definition at line 114 of file campaigns.h.
Referenced by enter(), isLoaded(), loadCampaign(), and unload().
|
private |
The UID of the campaign we should change to.
Definition at line 130 of file campaigns.h.
Referenced by changeCampaign(), replaceCampaign(), and unload().
|
private |
The player character we use.
Definition at line 127 of file campaigns.h.
Referenced by enter(), getPC(), unloadPC(), and usePC().
|
private |
Are we currently running a campaign?
Definition at line 115 of file campaigns.h.
Referenced by enter(), isRunning(), leave(), and unload().