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

#include <game.h>

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

Public Member Functions

 Game (NWNEngine &engine, ::Engines::Console &console, const Version &version)
 
 ~Game ()
 
const VersiongetVersion () const
 
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 getModules (std::vector< Common::UString > &modules)
 Return a list of all modules. More...
 
static void getPremiumModules (std::vector< Common::UString > &modules)
 Return a list of all premium modules. More...
 
static bool hasPremiumModules ()
 Do we actually have any premium modules installed at all? More...
 
static bool isPremiumModule (const Common::UString &module)
 Is this module file (including extension) a premium module? More...
 
static bool hasModule (Common::UString &module)
 Does this module exist? More...
 
static void getCharacters (std::vector< Common::UString > &characters, bool local)
 Return a list of local player characters. More...
 

Private Member Functions

void stopMenuMusic ()
 
void playMenuMusic (Common::UString music="")
 
void mainMenu (bool playStartSound, bool showLegal)
 
void runModule ()
 

Private Attributes

NWNEngine_engine
 
Common::ScopedPtr< Module_module
 
Common::ScopedPtr< Functions_functions
 
::Engines::Console_console
 
const Version_version
 
Sound::ChannelHandle _menuMusic
 

Detailed Description

Definition at line 48 of file game.h.

Constructor & Destructor Documentation

◆ Game()

Engines::NWN::Game::Game ( NWNEngine engine,
::Engines::Console console,
const Version version 
)

Definition at line 57 of file game.cpp.

References _functions.

◆ ~Game()

Engines::NWN::Game::~Game ( )

Definition at line 63 of file game.cpp.

Member Function Documentation

◆ getCharacters()

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

Return a list of local player characters.

Definition at line 190 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 Engines::NWN::CharPremadeMenu::initCharacterList().

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

◆ getModule()

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

◆ getModules()

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

◆ getPremiumModules()

void Engines::NWN::Game::getPremiumModules ( std::vector< Common::UString > &  modules)
static

Return a list of all premium modules.

Definition at line 230 of file game.cpp.

References ConfigMan, Common::FilePath::getStem(), and isPremiumModule().

Referenced by hasPremiumModules(), and Engines::NWN::NewPremiumMenu::initModuleList().

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

◆ getVersion()

const Version & Engines::NWN::Game::getVersion ( ) const

Definition at line 66 of file game.cpp.

References _version.

◆ hasModule()

bool Engines::NWN::Game::hasModule ( Common::UString module)
static

Does this module exist?

Definition at line 266 of file game.cpp.

References ResMan.

Referenced by Engines::NWN::Functions::startNewModule().

Here is the caller graph for this function:

◆ hasPremiumModules()

bool Engines::NWN::Game::hasPremiumModules ( )
static

Do we actually have any premium modules installed at all?

Definition at line 242 of file game.cpp.

References getPremiumModules().

Referenced by Engines::NWN::NewCampMenu::NewCampMenu().

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

◆ isPremiumModule()

bool Engines::NWN::Game::isPremiumModule ( const Common::UString module)
static

Is this module file (including extension) a premium module?

Definition at line 249 of file game.cpp.

References ARRAYSIZE, Common::UString::equalsIgnoreCase(), and Common::FilePath::getFile().

Referenced by getPremiumModules(), and Engines::NWN::Module::preparePremiumModule().

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

◆ mainMenu()

void Engines::NWN::Game::mainMenu ( bool  playStartSound,
bool  showLegal 
)
private

◆ playMenuMusic()

void Engines::NWN::Game::playMenuMusic ( Common::UString  music = "")
private

Definition at line 115 of file game.cpp.

References _menuMusic, ConfigMan, Common::UString::empty(), Sound::kSoundTypeMusic, Engines::playSound(), and stopMenuMusic().

Referenced by mainMenu(), and playMusic().

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

◆ playMusic()

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

Overwrite all currently playing music.

Definition at line 128 of file game.cpp.

References _module, Engines::NWN::Area::playAmbientMusic(), and playMenuMusic().

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

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

◆ run()

void Engines::NWN::Game::run ( )

Definition at line 76 of file game.cpp.

References _console, _module, _version, EventMan, mainMenu(), and runModule().

Here is the call graph for this function:

◆ runModule()

void Engines::NWN::Game::runModule ( )
private

Definition at line 89 of file game.cpp.

References _module, and EventMan.

Referenced by run().

Here is the caller graph for this function:

◆ stopMenuMusic()

void Engines::NWN::Game::stopMenuMusic ( )
private

Definition at line 124 of file game.cpp.

References _menuMusic, and SoundMan.

Referenced by mainMenu(), playMenuMusic(), and stopMusic().

Here is the caller graph for this function:

◆ stopMusic()

void Engines::NWN::Game::stopMusic ( )

Force all currently playing music stopped.

Definition at line 140 of file game.cpp.

References _module, Engines::NWN::Area::stopAmbientMusic(), and stopMenuMusic().

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

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

Member Data Documentation

◆ _console

::Engines::Console* Engines::NWN::Game::_console
private

Definition at line 85 of file game.h.

Referenced by mainMenu(), and run().

◆ _engine

NWNEngine* Engines::NWN::Game::_engine
private

Definition at line 80 of file game.h.

◆ _functions

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

Definition at line 83 of file game.h.

Referenced by Game().

◆ _menuMusic

Sound::ChannelHandle Engines::NWN::Game::_menuMusic
private

Definition at line 89 of file game.h.

Referenced by playMenuMusic(), and stopMenuMusic().

◆ _module

Common::ScopedPtr<Module> Engines::NWN::Game::_module
private

Definition at line 82 of file game.h.

Referenced by getModule(), mainMenu(), playMusic(), run(), runModule(), and stopMusic().

◆ _version

const Version* Engines::NWN::Game::_version
private

Definition at line 87 of file game.h.

Referenced by getVersion(), and run().


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