xoreos  0.0.5
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Engines::DragonAge::Campaigns Class Reference

#include <campaigns.h>

Collaboration diagram for Engines::DragonAge::Campaigns:
Collaboration graph
[legend]

Public Types

typedef Common::PtrVector< CampaignPlayableCampaigns
 
typedef Common::PtrVector< CampaignAddinContent
 

Public Member Functions

 Campaigns (::Engines::Console &console, Game &game)
 
 ~Campaigns ()
 
const PlayableCampaignsgetCampaigns () const
 Return all playable campaigns. More...
 
const AddinContentgetAddins () const
 Return all add-in content for other campaigns. More...
 
const CampaignfindCampaign (const Common::UString &uid) const
 Find a specific campaign by UID and return it, or 0 if not found. More...
 
const CampaignfindAddin (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...
 
CampaigngetCurrentCampaign () const
 Return the currently running campaign. More...
 
CreaturegetPC () 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::EventEventQueue
 

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)
 
CampaignreadCampaign (const Common::UString &cifPath="", const Common::UString &manifestPath="", const Common::UString &addinBase="")
 
CampaigngetCampaign (const Common::UString &uid)
 
CampaigngetAddin (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
 

Detailed Description

Definition at line 47 of file campaigns.h.

Member Typedef Documentation

◆ AddinContent

Definition at line 54 of file campaigns.h.

◆ EventQueue

Definition at line 108 of file campaigns.h.

◆ PlayableCampaigns

Definition at line 53 of file campaigns.h.

Constructor & Destructor Documentation

◆ Campaigns()

Engines::DragonAge::Campaigns::Campaigns ( ::Engines::Console console,
Game game 
)

Definition at line 47 of file campaigns.cpp.

References findCampaigns().

Here is the call graph for this function:

◆ ~Campaigns()

Engines::DragonAge::Campaigns::~Campaigns ( )

Definition at line 53 of file campaigns.cpp.

References clean().

Here is the call graph for this function:

Member Function Documentation

◆ addCampaign()

void Engines::DragonAge::Campaigns::addCampaign ( Campaign campaign)
private

Definition at line 144 of file campaigns.cpp.

References _addins, _campaigns, Common::UString::empty(), Engines::DragonAge::Campaign::getExtendsUID(), Engines::DragonAge::Campaign::getUID(), and Engines::DragonAge::Campaign::isEnabled().

Referenced by findCampaigns().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addEvent()

void Engines::DragonAge::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.

◆ changeCampaign()

void Engines::DragonAge::Campaigns::changeCampaign ( const Campaign campaign)
private

Schedule a change to a new campaign.

Definition at line 319 of file campaigns.cpp.

References _newCampaign, and Engines::DragonAge::Campaign::getUID().

Referenced by load().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clean()

void Engines::DragonAge::Campaigns::clean ( )
private

Definition at line 60 of file campaigns.cpp.

References _currentCampaign, and Engines::DragonAge::Campaign::unload().

Referenced by ~Campaigns().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enter()

void Engines::DragonAge::Campaigns::enter ( )

Enter the loaded campaign, starting it.

Definition at line 242 of file campaigns.cpp.

References _currentCampaign, _exit, _hasCampaign, _pc, _running, and Engines::DragonAge::Campaign::enter().

Referenced by replaceCampaign().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exit()

void Engines::DragonAge::Campaigns::exit ( )

Exit the currently running campaign.

Definition at line 187 of file campaigns.cpp.

References _exit.

◆ findAddin()

const Campaign * Engines::DragonAge::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.

◆ findCampaign()

const Campaign * Engines::DragonAge::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.

◆ findCampaigns()

void Engines::DragonAge::Campaigns::findCampaigns ( )
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAddin()

Campaign * Engines::DragonAge::Campaigns::getAddin ( const Common::UString uid)
private

Definition at line 97 of file campaigns.cpp.

References _addins.

◆ getAddins()

const Campaigns::AddinContent & Engines::DragonAge::Campaigns::getAddins ( ) const

Return all add-in content for other campaigns.

Definition at line 69 of file campaigns.cpp.

References _addins.

◆ getCampaign()

Campaign * Engines::DragonAge::Campaigns::getCampaign ( const Common::UString uid)
private

Definition at line 89 of file campaigns.cpp.

References _campaigns.

Referenced by loadCampaign(), and replaceCampaign().

Here is the caller graph for this function:

◆ getCampaigns()

const Campaigns::PlayableCampaigns & Engines::DragonAge::Campaigns::getCampaigns ( ) const

Return all playable campaigns.

Definition at line 65 of file campaigns.cpp.

References _campaigns.

Referenced by Engines::DragonAge::Console::cmdListCampaigns(), Engines::DragonAge::Console::cmdLoadCampaign(), and Engines::DragonAge::Console::updateCampaigns().

Here is the caller graph for this function:

◆ getCurrentCampaign()

Campaign * Engines::DragonAge::Campaigns::getCurrentCampaign ( ) const

◆ getPC()

Creature * Engines::DragonAge::Campaigns::getPC ( ) const

Return the currently playing PC.

Definition at line 315 of file campaigns.cpp.

References _pc.

◆ handleEvents()

void Engines::DragonAge::Campaigns::handleEvents ( )
private

◆ isLoaded()

bool Engines::DragonAge::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::DragonAge::Campaign::isLoaded().

Here is the call graph for this function:

◆ isRunning()

bool Engines::DragonAge::Campaigns::isRunning ( ) const

Is a campaign currently running?

Definition at line 109 of file campaigns.cpp.

References _currentCampaign, _exit, _running, EventMan, and Engines::DragonAge::Campaign::isLoaded().

Referenced by load(), and processEventQueue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ leave()

void Engines::DragonAge::Campaigns::leave ( )

Leave the running campaign, quitting it.

Definition at line 255 of file campaigns.cpp.

References _currentCampaign, _exit, _running, and Engines::DragonAge::Campaign::leave().

Here is the call graph for this function:

◆ load()

void Engines::DragonAge::Campaigns::load ( const Campaign campaign)

Load a campaign.

Definition at line 175 of file campaigns.cpp.

References changeCampaign(), isRunning(), and loadCampaign().

Referenced by Engines::DragonAge::Console::cmdLoadCampaign().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadCampaign()

void Engines::DragonAge::Campaigns::loadCampaign ( const Campaign campaign)
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::DragonAge::Campaign::getName(), Aurora::LocString::getString(), Engines::DragonAge::Campaign::getUID(), Engines::DragonAge::Campaign::load(), and unload().

Referenced by load(), and replaceCampaign().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ processEventQueue()

void Engines::DragonAge::Campaigns::processEventQueue ( )

Process the current event queue.

Definition at line 267 of file campaigns.cpp.

References handleEvents(), isRunning(), and replaceCampaign().

Here is the call graph for this function:

◆ readCampaign()

Campaign * Engines::DragonAge::Campaigns::readCampaign ( const Common::UString cifPath = "",
const Common::UString manifestPath = "",
const Common::UString addinBase = "" 
)
private

Definition at line 156 of file campaigns.cpp.

References _game, Common::UString::empty(), Common::exceptionDispatcherWarning(), and Common::FilePath::getStem().

Referenced by findCampaigns().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ refreshLocalized()

void Engines::DragonAge::Campaigns::refreshLocalized ( )

Refresh all localized strings.

Definition at line 337 of file campaigns.cpp.

◆ replaceCampaign()

void Engines::DragonAge::Campaigns::replaceCampaign ( )
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unload() [1/2]

void Engines::DragonAge::Campaigns::unload ( )

Completely unload the currently loaded campaign.

Definition at line 191 of file campaigns.cpp.

Referenced by loadCampaign().

Here is the caller graph for this function:

◆ unload() [2/2]

void Engines::DragonAge::Campaigns::unload ( bool  completeUnload)
private

Unload the whole shebang.

Parameters
completeUnloadAlso 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::DragonAge::Campaign::unload(), and unloadPC().

Here is the call graph for this function:

◆ unloadPC()

void Engines::DragonAge::Campaigns::unloadPC ( )
private

Definition at line 213 of file campaigns.cpp.

References _pc.

Referenced by unload().

Here is the caller graph for this function:

◆ usePC()

void Engines::DragonAge::Campaigns::usePC ( Creature pc)

Use this character as the player character.

Definition at line 238 of file campaigns.cpp.

References _pc.

Member Data Documentation

◆ _addins

AddinContent Engines::DragonAge::Campaigns::_addins
private

All add-in content we know about.

Definition at line 121 of file campaigns.h.

Referenced by addCampaign(), findAddin(), getAddin(), and getAddins().

◆ _campaigns

PlayableCampaigns Engines::DragonAge::Campaigns::_campaigns
private

All campaigns we know about.

Definition at line 119 of file campaigns.h.

Referenced by addCampaign(), findCampaign(), getCampaign(), and getCampaigns().

◆ _console

::Engines::Console* Engines::DragonAge::Campaigns::_console
private

Definition at line 111 of file campaigns.h.

Referenced by handleEvents().

◆ _currentCampaign

Campaign* Engines::DragonAge::Campaigns::_currentCampaign
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().

◆ _eventQueue

EventQueue Engines::DragonAge::Campaigns::_eventQueue
private

Definition at line 132 of file campaigns.h.

Referenced by addEvent(), handleEvents(), and unload().

◆ _exit

bool Engines::DragonAge::Campaigns::_exit
private

Should we exit the campaign?

Definition at line 116 of file campaigns.h.

Referenced by enter(), exit(), isRunning(), leave(), and unload().

◆ _game

Game* Engines::DragonAge::Campaigns::_game
private

Definition at line 112 of file campaigns.h.

Referenced by readCampaign().

◆ _hasCampaign

bool Engines::DragonAge::Campaigns::_hasCampaign
private

Do we have a campaign?

Definition at line 114 of file campaigns.h.

Referenced by enter(), isLoaded(), loadCampaign(), and unload().

◆ _newCampaign

Common::UString Engines::DragonAge::Campaigns::_newCampaign
private

The UID of the campaign we should change to.

Definition at line 130 of file campaigns.h.

Referenced by changeCampaign(), replaceCampaign(), and unload().

◆ _pc

Common::ScopedPtr<Creature> Engines::DragonAge::Campaigns::_pc
private

The player character we use.

Definition at line 127 of file campaigns.h.

Referenced by enter(), getPC(), unloadPC(), and usePC().

◆ _running

bool Engines::DragonAge::Campaigns::_running
private

Are we currently running a campaign?

Definition at line 115 of file campaigns.h.

Referenced by enter(), isRunning(), leave(), and unload().


The documentation for this class was generated from the following files: