ScummVM
Titanic::TitanicEngine Class Reference

#include <titanic.h>

+ Inheritance diagram for Titanic::TitanicEngine:
+ Collaboration diagram for Titanic::TitanicEngine:

Public Member Functions

 TitanicEngine (OSystem *syst, const TitanicGameDescription *gameDesc)
 
 ~TitanicEngine () override
 
bool canLoadGameStateCurrently () override
 Returns true if a savegame can be loaded. More...
 
bool canSaveGameStateCurrently () override
 Returns true if the game can be saved. More...
 
Common::Error loadGameState (int slot) override
 Called by the GMM to load a savegame. More...
 
Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false) override
 Called by the GMM to save the game. More...
 
void syncSoundSettings () override
 Handles updates to the sound levels. More...
 
uint32 getFeatures () const
 Gets the game features. More...
 
Common::Language getLanguage () const
 Returns the language for the game. More...
 
bool isGerman () const
 Returns true if it's the German version. More...
 
uint getRandomNumber (uint max)
 Returns a uniform random unsigned integer in the interval [0, max]. More...
 
double getRandomFloat ()
 Returns a uniform random floating point number in the interval [0.0, 65535.0]. More...
 
CString getSavegameName (int slot)
 Checks whether a savegame exists for the given slot, and if it exists, returns it's description. More...
 
- Public Member Functions inherited from Engine
 Engine (OSystem *syst)
 
virtual ~Engine ()
 
virtual void errorString (const char *buf_input, char *buf_output, int buf_output_size)
 Prepare an error string, which is printed by the error() function. More...
 
virtual GUI::DebuggergetDebugger ()
 Return the engine's debugger instance, if any. More...
 
void setDebugger (GUI::Debugger *debugger)
 Sets the engine's debugger. More...
 
GUI::DebuggergetOrCreateDebugger ()
 Return the engine's debugger instance, or create one if none is present. More...
 
virtual void flipMute ()
 Flip mute all sound option. More...
 
virtual Common::String getSaveStateName (int slot) const
 Generates the savegame filename. More...
 
virtual Common::Error loadGameStream (Common::SeekableReadStream *stream)
 Load a game state. More...
 
void setGameToLoadSlot (int slot)
 Sets the game slot for a savegame to be loaded after global main menu execution. More...
 
virtual Common::Error saveGameStream (Common::WriteStream *stream, bool isAutosave=false)
 Save a game state. More...
 
bool saveGameDialog ()
 Shows the ScummVM save dialog, allowing users to save their game. More...
 
bool loadGameDialog ()
 Shows the ScummVM Restore dialog, allowing users to load a game. More...
 
void pauseEngine (bool pause)
 Pause or resume the engine. More...
 
bool isPaused () const
 Return whether the engine is currently paused or not. More...
 
void openMainMenuDialog ()
 Run the Global Main Menu Dialog. More...
 
uint32 getTotalPlayTime () const
 Get the total play time. More...
 
void setTotalPlayTime (uint32 time=0)
 Set the game time counter to the specified time. More...
 
Common::TimerManagergetTimerManager ()
 
Common::EventManagergetEventManager ()
 
Common::SaveFileManagergetSaveFileManager ()
 
void checkCD ()
 On some systems, check if the game appears to be run from CD. More...
 
void handleAutoSave ()
 Checks for whether it's time to do an autosave, and if so, does it. More...
 
void saveAutosaveIfEnabled ()
 Does an autosave immediately if autosaves are turned on. More...
 
virtual bool canSaveAutosaveCurrently ()
 Indicates whether an autosave can currently be saved. More...
 
virtual int getAutosaveSlot () const
 Returns the slot that should be used for autosaves. More...
 
bool shouldPerformAutoSave (int lastSaveTime)
 

Public Attributes

Events_events
 
CFilesManager_filesManager
 
CMovieManager _movieManager
 
Graphics::Screen_screen
 
OSScreenManager_screenManager
 
CMainGameWindow_window
 
Common::RandomSource _randomSource
 
CScriptHandler_scriptHandler
 
TTscriptBase_script
 
CTrueTalkManager_trueTalkManager
 
CExeResources _exeResources
 
StringArray _itemNames
 
StringArray _itemDescriptions
 
StringArray _itemIds
 
StringArray _roomNames
 
Strings _strings
 
CString _stateRoomExitView
 
int _loadSaveSlot
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Protected Member Functions

void initializePath (const Common::FSNode &gamePath) override
 Init SearchMan according to the game path. More...
 
Common::Error run () override
 Init the engine and start its main loop. More...
 
bool hasFeature (EngineFeature f) const override
 Determine whether the engine supports the specified feature. More...
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
virtual void pauseEngineIntern (bool pause)
 Actual implementation of pauseEngine by subclasses. More...
 

Protected Attributes

const TitanicGameDescription_gameDescription
 
- Protected Attributes inherited from Engine
Common::TimerManager_timer
 
Common::EventManager_eventMan
 
Common::SaveFileManager_saveFileMan
 
GUI::Dialog_mainMenuDialog
 
const Common::String _targetName
 

Private Member Functions

bool initialize ()
 Handles basic initialization. More...
 
void deinitialize ()
 Handles game deinitialization. More...
 
void setItemNames ()
 Sets up the item names, short, and long descriptions. More...
 
void setRoomNames ()
 Sets up the list of room names. More...
 

Additional Inherited Members

- Public Types inherited from Engine
enum  EngineFeature { kSupportsSubtitleOptions, kSupportsRTL, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime }
 A feature in this context means an ability of the engine which can be either available or not. More...
 
- Static Public Member Functions inherited from Engine
static void quitGame ()
 Request the engine to quit. More...
 
static bool shouldQuit ()
 Return whether the ENGINE should quit respectively should return to the launcher. More...
 
static MetaEnginegetMetaEngine ()
 
static bool warnUserAboutUnsupportedGame ()
 Display a warning to the user that the game is not fully supported. More...
 

Detailed Description

Definition at line 82 of file titanic.h.

Constructor & Destructor Documentation

◆ TitanicEngine()

Titanic::TitanicEngine::TitanicEngine ( OSystem syst,
const TitanicGameDescription gameDesc 
)

Definition at line 59 of file titanic.cpp.

◆ ~TitanicEngine()

Titanic::TitanicEngine::~TitanicEngine ( )
override

Definition at line 80 of file titanic.cpp.

Member Function Documentation

◆ canLoadGameStateCurrently()

bool Titanic::TitanicEngine::canLoadGameStateCurrently ( )
overridevirtual

Returns true if a savegame can be loaded.

Reimplemented from Engine.

Definition at line 187 of file titanic.cpp.

◆ canSaveGameStateCurrently()

bool Titanic::TitanicEngine::canSaveGameStateCurrently ( )
overridevirtual

Returns true if the game can be saved.

Reimplemented from Engine.

Definition at line 216 of file titanic.cpp.

◆ deinitialize()

void Titanic::TitanicEngine::deinitialize ( )
private

Handles game deinitialization.

Definition at line 128 of file titanic.cpp.

◆ getFeatures()

uint32 Titanic::TitanicEngine::getFeatures ( ) const

Gets the game features.

Definition at line 42 of file detection.cpp.

◆ getLanguage()

Common::Language Titanic::TitanicEngine::getLanguage ( ) const

Returns the language for the game.

Definition at line 46 of file detection.cpp.

◆ getRandomFloat()

double Titanic::TitanicEngine::getRandomFloat ( )
inline

Returns a uniform random floating point number in the interval [0.0, 65535.0].

Definition at line 182 of file titanic.h.

◆ getRandomNumber()

uint Titanic::TitanicEngine::getRandomNumber ( uint  max)
inline

Returns a uniform random unsigned integer in the interval [0, max].

Definition at line 177 of file titanic.h.

◆ getSavegameName()

CString Titanic::TitanicEngine::getSavegameName ( int  slot)

Checks whether a savegame exists for the given slot, and if it exists, returns it's description.

Definition at line 239 of file titanic.cpp.

◆ hasFeature()

bool Titanic::TitanicEngine::hasFeature ( EngineFeature  f) const
overrideprotectedvirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 97 of file detection.cpp.

◆ initialize()

bool Titanic::TitanicEngine::initialize ( )
private

Handles basic initialization.

Definition at line 88 of file titanic.cpp.

◆ initializePath()

void Titanic::TitanicEngine::initializePath ( const Common::FSNode gamePath)
overrideprotectedvirtual

Init SearchMan according to the game path.

By default it adds the directory in non-flat mode with a depth of 4 as priority 0 to SearchMan.

Parameters
gamePathThe base directory of the game data.

Reimplemented from Engine.

Definition at line 83 of file titanic.cpp.

◆ isGerman()

bool Titanic::TitanicEngine::isGerman ( ) const
inline

Returns true if it's the German version.

Definition at line 172 of file titanic.h.

◆ loadGameState()

Common::Error Titanic::TitanicEngine::loadGameState ( int  slot)
overridevirtual

Called by the GMM to load a savegame.

Reimplemented from Engine.

Definition at line 225 of file titanic.cpp.

◆ run()

Common::Error Titanic::TitanicEngine::run ( )
overrideprotectedvirtual

Init the engine and start its main loop.

Returns
returns kNoError on success, else an error code.

Implements Engine.

Definition at line 149 of file titanic.cpp.

◆ saveGameState()

Common::Error Titanic::TitanicEngine::saveGameState ( int  slot,
const Common::String desc,
bool  isAutosave = false 
)
overridevirtual

Called by the GMM to save the game.

Reimplemented from Engine.

Definition at line 234 of file titanic.cpp.

◆ setItemNames()

void Titanic::TitanicEngine::setItemNames ( )
private

Sets up the item names, short, and long descriptions.

Definition at line 162 of file titanic.cpp.

◆ setRoomNames()

void Titanic::TitanicEngine::setRoomNames ( )
private

Sets up the list of room names.

Definition at line 180 of file titanic.cpp.

◆ syncSoundSettings()

void Titanic::TitanicEngine::syncSoundSettings ( )
overridevirtual

Handles updates to the sound levels.

Reimplemented from Engine.

Definition at line 261 of file titanic.cpp.

Member Data Documentation

◆ _events

Events* Titanic::TitanicEngine::_events

Definition at line 111 of file titanic.h.

◆ _exeResources

CExeResources Titanic::TitanicEngine::_exeResources

Definition at line 121 of file titanic.h.

◆ _filesManager

CFilesManager* Titanic::TitanicEngine::_filesManager

Definition at line 112 of file titanic.h.

◆ _gameDescription

const TitanicGameDescription* Titanic::TitanicEngine::_gameDescription
protected

Definition at line 104 of file titanic.h.

◆ _itemDescriptions

StringArray Titanic::TitanicEngine::_itemDescriptions

Definition at line 123 of file titanic.h.

◆ _itemIds

StringArray Titanic::TitanicEngine::_itemIds

Definition at line 124 of file titanic.h.

◆ _itemNames

StringArray Titanic::TitanicEngine::_itemNames

Definition at line 122 of file titanic.h.

◆ _loadSaveSlot

int Titanic::TitanicEngine::_loadSaveSlot

Definition at line 128 of file titanic.h.

◆ _movieManager

CMovieManager Titanic::TitanicEngine::_movieManager

Definition at line 113 of file titanic.h.

◆ _randomSource

Common::RandomSource Titanic::TitanicEngine::_randomSource

Definition at line 117 of file titanic.h.

◆ _roomNames

StringArray Titanic::TitanicEngine::_roomNames

Definition at line 125 of file titanic.h.

◆ _screen

Graphics::Screen* Titanic::TitanicEngine::_screen

Definition at line 114 of file titanic.h.

◆ _screenManager

OSScreenManager* Titanic::TitanicEngine::_screenManager

Definition at line 115 of file titanic.h.

◆ _script

TTscriptBase* Titanic::TitanicEngine::_script

Definition at line 119 of file titanic.h.

◆ _scriptHandler

CScriptHandler* Titanic::TitanicEngine::_scriptHandler

Definition at line 118 of file titanic.h.

◆ _stateRoomExitView

CString Titanic::TitanicEngine::_stateRoomExitView

Definition at line 127 of file titanic.h.

◆ _strings

Strings Titanic::TitanicEngine::_strings

Definition at line 126 of file titanic.h.

◆ _trueTalkManager

CTrueTalkManager* Titanic::TitanicEngine::_trueTalkManager

Definition at line 120 of file titanic.h.

◆ _window

CMainGameWindow* Titanic::TitanicEngine::_window

Definition at line 116 of file titanic.h.


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