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)) {
#define ResMan
Shortcut for accessing the sound manager.
void changeCampaign(const Campaign &campaign)
Schedule a change to a new campaign.
bool _exit
Should we exit the campaign?
void add(const char *s,...) GCC_PRINTF(2
A class holding an UTF-8 string.
void addCampaign(Campaign *campaign)
The context holding a Dragon Age: Origins campaign.
bool isLoaded() const
Is a campaign currently loaded and ready to run?
static bool getSubDirectories(const UString &directory, std::list< UString > &subDirectories)
Collect all direct subdirectories of a directory in a list.
bool isLoaded() const
Is this campaign currently loaded?
A creature in a Dragon Age: Origins area.
void unload()
Unload the campaign after playing.
const PlayableCampaigns & getCampaigns() const
Return all playable campaigns.
void leave()
Leave the running campaign, quitting it.
Campaigns(::Engines::Console &console, Game &game)
bool isEnabled() const
Is this Campaign enabled?
const Common::UString & getString(Language language, LanguageGender gender=kLanguageGenderCurrent) const
Get the string of that language.
const Campaign * findAddin(const Common::UString &uid) const
Find a specific add-in by UID and return it, or 0 if not found.
Exception that provides a stack of explanations.
void unload()
Completely unload the currently loaded campaign.
Campaign * readCampaign(const Common::UString &cifPath="", const Common::UString &manifestPath="", const Common::UString &addinBase="")
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...
const Aurora::LocString & getName() const
bool _running
Are we currently running a campaign?
Keyboard key was pressed.
const AddinContent & getAddins() const
Return all add-in content for other campaigns.
void exit()
Exit the currently running campaign.
void leave()
Leave the campaign, ending it.
void addEvent(const Events::Event &event)
Add a single event for consideration into the event queue.
Basic exceptions to throw.
const char * c_str() const
Return the (utf8 encoded) string data.
The context handling the gameplay in Dragon Age: Origins.
void load(const Campaign &campaign)
Load a campaign.
Common::UString _newCampaign
The UID of the campaign we should change to.
Campaign * getCampaign(const Common::UString &uid)
Creature * getPC() const
Return the currently playing PC.
Common::ScopedPtr< Creature > _pc
The player character we use.
void load()
Load the campaign for playing.
void processEventQueue()
Process the current event queue.
The global events manager.
bool empty() const
Is the string empty?
Generic Aurora engines (debug) console.
void usePC(Creature *pc)
Use this character as the player character.
void refreshLocalized()
Refresh all localized strings.
void enter()
Enter the loaded campaign, starting it.
void replaceCampaign()
Actually replace the currently running campaign.
Campaign * getAddin(const Common::UString &uid)
void enter(Creature &pc)
Enter the campaign, starting it.
#define EventMan
Shortcut for accessing the events manager.
Campaign * getCurrentCampaign() const
Return the currently running campaign.
PlayableCampaigns _campaigns
All campaigns we know about.
static UString getStem(const UString &p)
Return a file name's stem.
bool _hasCampaign
Do we have a campaign?
UString findFirstGlob(const UString &glob, bool caseInsensitive) const
Find the first file matching the given regex.
void loadCampaign(const Campaign &campaign)
Load a new campaign.
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)
#define CameraMan
Shortcut for accessing the camera manager.
void addEvent(const Events::Event &event)
Add a single event for consideration into the area event queue.
Campaign * _currentCampaign
The currently loaded campaign.
The context managing and running the Dragon Age: Origins campaigns.
Engine utility class for free-roam camera handling.
void processEventQueue()
Process the current event queue.
const Campaign * findCampaign(const Common::UString &uid) const
Find a specific campaign by UID and return it, or 0 if not found.
void clear()
Clear the string's contents.
const Common::UString & getExtendsUID() const
Return the UID of the campaign this campaign/content extends, if any.
::Engines::Console * _console
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.
const Common::UString & getUID() const
Return the unique ID of this campaign.
bool isRunning() const
Is a campaign currently running?