45 namespace DragonAge2 {
48 _hasCampaign(false), _running(false), _exit(true), _currentCampaign(0) {
75 if ((*c)->getUID().equalsIgnoreCase(uid))
82 for (AddinContent::const_iterator a =
_addins.begin(); a !=
_addins.end(); ++a)
83 if ((*a)->getUID().equalsIgnoreCase(uid))
91 if ((*c)->getUID().equalsIgnoreCase(uid))
98 for (AddinContent::iterator a =
_addins.begin(); a !=
_addins.end(); ++a)
99 if ((*a)->getUID().equalsIgnoreCase(uid))
114 status(
"Looking for campaigns...");
128 std::list<Common::UString> dlcDirs;
131 for (std::list<Common::UString>::const_iterator d = dlcDirs.begin(); d != dlcDirs.end(); ++d) {
165 campaign =
new Campaign(*
_game, cifPath, manifestPath, addinBase);
230 e.
add(
"Failed loading campaign \"%s\" (\"%s\")",
289 if ((event->key.keysym.sym == SDLK_d) && (event->key.keysym.mod & KMOD_CTRL)) {
const PlayableCampaigns & getCampaigns() const
Return all playable campaigns.
#define ResMan
Shortcut for accessing the sound manager.
void changeCampaign(const Campaign &campaign)
Schedule a change to a new campaign.
const Common::UString & getExtendsUID() const
Return the UID of the campaign this campaign/content extends, if any.
void add(const char *s,...) GCC_PRINTF(2
void leave()
Leave the campaign, ending it.
A creature in a Dragon Age II area.
const AddinContent & getAddins() const
Return all add-in content for other campaigns.
void enter(Creature &pc)
Enter the campaign, starting it.
A class holding an UTF-8 string.
void loadCampaign(const Campaign &campaign)
Load a new campaign.
Campaign * getCampaign(const Common::UString &uid)
static bool getSubDirectories(const UString &directory, std::list< UString > &subDirectories)
Collect all direct subdirectories of a directory in a list.
bool _hasCampaign
Do we have a campaign?
bool isEnabled() const
Is this Campaign enabled?
void leave()
Leave the running campaign, quitting it.
Campaigns(::Engines::Console &console, Game &game)
The context handling the gameplay in Dragon Age II.
bool isLoaded() const
Is this campaign currently loaded?
const Common::UString & getString(Language language, LanguageGender gender=kLanguageGenderCurrent) const
Get the string of that language.
Exception that provides a stack of explanations.
UString findFirst(const UString &str, bool caseInsensitive) const
Find the first file ending with the given string.
void exceptionDispatcherWarning(const char *s,...)
Exception dispatcher that prints the exception as a warning, and adds another reason on top...
Keyboard key was pressed.
Basic exceptions to throw.
Campaign * readCampaign(const Common::UString &cifPath="", const Common::UString &manifestPath="", const Common::UString &addinBase="")
const char * c_str() const
Return the (utf8 encoded) string data.
Campaign * _currentCampaign
The currently loaded campaign.
Common::UString _newCampaign
The UID of the campaign we should change to.
The global events manager.
const Campaign * findAddin(const Common::UString &uid) const
Find a specific add-in by UID and return it, or 0 if not found.
bool empty() const
Is the string empty?
Generic Aurora engines (debug) console.
::Engines::Console * _console
Campaign * getAddin(const Common::UString &uid)
void enter()
Enter the loaded campaign, starting it.
void addCampaign(Campaign *campaign)
bool isRunning() const
Is a campaign currently running?
#define EventMan
Shortcut for accessing the events manager.
void refreshLocalized()
Refresh all localized strings.
Campaign * getCurrentCampaign() const
Return the currently running campaign.
void exit()
Exit the currently running campaign.
Creature * getPC() const
Return the currently playing PC.
void replaceCampaign()
Actually replace the currently running campaign.
The context holding a Dragon Age II campaign.
const Campaign * findCampaign(const Common::UString &uid) const
Find a specific campaign by UID and return it, or 0 if not found.
void usePC(Creature *pc)
Use this character as the player character.
void load(const Campaign &campaign)
Load a campaign.
The context managing and running the Dragon Age II campaigns.
static UString getStem(const UString &p)
Return a file name's stem.
UString findFirstGlob(const UString &glob, bool caseInsensitive) const
Find the first file matching the given regex.
void unload()
Unload the campaign after playing.
static UString relativize(const UString &basePath, const UString &path)
Return the path relative to the base path.
AddinContent _addins
All add-in content we know about.
void status(const char *s,...)
bool processEvent(const Events::Event &event)
void addEvent(const Events::Event &event)
Add a single event for consideration into the event queue.
#define CameraMan
Shortcut for accessing the camera manager.
void load()
Load the campaign for playing.
bool _exit
Should we exit the campaign?
bool isLoaded() const
Is a campaign currently loaded and ready to run?
Common::ScopedPtr< Creature > _pc
The player character we use.
const Common::UString & getUID() const
Return the unique ID of this campaign.
void unload()
Completely unload the currently loaded campaign.
void processEventQueue()
Process the current event queue.
PlayableCampaigns _campaigns
All campaigns we know about.
const Aurora::LocString & getName() const
void processEventQueue()
Process the current event queue.
Engine utility class for free-roam camera handling.
void clear()
Clear the string's contents.
bool _running
Are we currently running a campaign?
The global resource manager for Aurora resources.
Utility class for manipulating file paths.
static UString findSubDirectory(const UString &directory, const UString &subDirectory, bool caseInsensitive=false)
Find a directory's subdirectory.
void addEvent(const Events::Event &event)
Add a single event for consideration into the area event queue.