xoreos  0.0.5
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Engines::NWN2::Game Class Reference

#include <game.h>

Collaboration diagram for Engines::NWN2::Game:
Collaboration graph
[legend]

Public Member Functions

 Game (NWN2Engine &engine, ::Engines::Console &console)
 
 ~Game ()
 
CampaigngetCampaign ()
 Return the campaign context. More...
 
ModulegetModule ()
 Return the module context. More...
 
void playMusic (const Common::UString &music="")
 Overwrite all currently playing music. More...
 
void stopMusic ()
 Force all currently playing music stopped. More...
 
void run ()
 

Static Public Member Functions

static void getCampaigns (std::vector< Common::UString > &campaigns)
 Return a list of all campaigns. More...
 
static void getModules (std::vector< Common::UString > &modules)
 Return a list of all modules. More...
 
static void getCharacters (std::vector< Common::UString > &characters, bool local)
 Return a list of local player characters. More...
 

Private Member Functions

void runCampaign ()
 

Private Attributes

NWN2Engine_engine
 
Common::ScopedPtr< Campaign_campaign
 
Common::ScopedPtr< Functions_functions
 
::Engines::Console_console
 

Detailed Description

Definition at line 48 of file game.h.

Constructor & Destructor Documentation

◆ Game()

Engines::NWN2::Game::Game ( NWN2Engine engine,
::Engines::Console console 
)

Definition at line 49 of file game.cpp.

References _functions.

◆ ~Game()

Engines::NWN2::Game::~Game ( )

Definition at line 55 of file game.cpp.

Member Function Documentation

◆ getCampaign()

Campaign & Engines::NWN2::Game::getCampaign ( )

◆ getCampaigns()

void Engines::NWN2::Game::getCampaigns ( std::vector< Common::UString > &  campaigns)
static

Return a list of all campaigns.

Definition at line 135 of file game.cpp.

References Common::FileList::begin(), ConfigMan, Common::UString::empty(), Common::FileList::end(), Common::UString::equalsIgnoreCase(), Common::FilePath::getDirectory(), Common::FilePath::getFile(), and Common::FilePath::relativize().

Referenced by Engines::NWN2::Console::updateCampaigns().

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

◆ getCharacters()

void Engines::NWN2::Game::getCharacters ( std::vector< Common::UString > &  characters,
bool  local 
)
static

Return a list of local player characters.

Definition at line 173 of file game.cpp.

References Common::FileList::addDirectory(), Common::FileList::begin(), ConfigMan, Common::UString::empty(), Common::FileList::end(), Common::UString::equalsIgnoreCase(), Common::FilePath::getExtension(), and Common::FilePath::getStem().

Referenced by runCampaign().

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

◆ getModule()

Module & Engines::NWN2::Game::getModule ( )

◆ getModules()

void Engines::NWN2::Game::getModules ( std::vector< Common::UString > &  modules)
static

Return a list of all modules.

Definition at line 156 of file game.cpp.

References Common::FileList::begin(), ConfigMan, Common::FileList::end(), Common::UString::equalsIgnoreCase(), Common::FilePath::getExtension(), and Common::FilePath::getStem().

Referenced by Engines::NWN2::Functions::startNewModule(), and Engines::NWN2::Console::updateModules().

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

◆ playMusic()

void Engines::NWN2::Game::playMusic ( const Common::UString music = "")

Overwrite all currently playing music.

Definition at line 113 of file game.cpp.

References _campaign, and Engines::NWN2::Area::playAmbientMusic().

Referenced by Engines::NWN2::Console::cmdPlayMusic().

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

◆ run()

void Engines::NWN2::Game::run ( )

Definition at line 70 of file game.cpp.

References _campaign, _console, EventMan, and runCampaign().

Here is the call graph for this function:

◆ runCampaign()

void Engines::NWN2::Game::runCampaign ( )
private

Definition at line 80 of file game.cpp.

References _campaign, EventMan, and getCharacters().

Referenced by run().

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

◆ stopMusic()

void Engines::NWN2::Game::stopMusic ( )

Force all currently playing music stopped.

Definition at line 124 of file game.cpp.

References _campaign, and Engines::NWN2::Area::stopAmbientMusic().

Referenced by Engines::NWN2::Console::cmdStopMusic().

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

Member Data Documentation

◆ _campaign

Common::ScopedPtr<Campaign> Engines::NWN2::Game::_campaign
private

Definition at line 76 of file game.h.

Referenced by getCampaign(), getModule(), playMusic(), run(), runCampaign(), and stopMusic().

◆ _console

::Engines::Console* Engines::NWN2::Game::_console
private

Definition at line 79 of file game.h.

Referenced by run().

◆ _engine

NWN2Engine* Engines::NWN2::Game::_engine
private

Definition at line 74 of file game.h.

◆ _functions

Common::ScopedPtr<Functions> Engines::NWN2::Game::_functions
private

Definition at line 77 of file game.h.

Referenced by Game().


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