ScummVM
Sherlock::SherlockEngine Class Referenceabstract

#include <sherlock.h>

+ Inheritance diagram for Sherlock::SherlockEngine:
+ Collaboration diagram for Sherlock::SherlockEngine:

Public Member Functions

 SherlockEngine (OSystem *syst, const SherlockGameDescription *gameDesc)
 
 ~SherlockEngine () override
 
Common::Error run () override
 Main method for running the game. More...
 
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
 Called by the engine when sound settings are updated. More...
 
virtual void saveConfig ()
 Saves game configuration information. More...
 
virtual bool isDemo () const
 Returns whether the version is a demo. More...
 
GameType getGameID () const
 Returns the Id of the game. More...
 
Common::Platform getPlatform () const
 Returns the platform the game's datafiles are for. More...
 
Common::Language getLanguage () const
 Return the game's language. More...
 
int getRandomNumber (int limit)
 Return a random number. More...
 
bool readFlags (int flagNum)
 Read the state of a global flag. More...
 
void setFlags (int flagNum)
 Sets a global flag to either true or false depending on whether the specified flag is positive or negative. More...
 
void setFlagsDirect (int flagNum)
 Set a global flag to 0 or 1 depending on whether the passed flag is negative or positive. More...
 
void synchronize (Serializer &s)
 Synchronize the data for a savegame. More...
 
- Public Member Functions inherited from Engine
 Engine (OSystem *syst)
 
virtual ~Engine ()
 
virtual void initializePath (const Common::FSNode &gamePath)
 Init SearchMan according to the game path. More...
 
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

const SherlockGameDescription_gameDescription
 
Animation_animation
 
Debugger_debugger
 
Events_events
 
FixedText_fixedText
 
Inventory_inventory
 
Journal_journal
 
Map_map
 
Music_music
 
People_people
 
Resources_res
 
SaveManager_saves
 
Scene_scene
 
Screen_screen
 
Sound_sound
 
Talk_talk
 
UserInterface_ui
 
Common::RandomSource _randomSource
 
Common::Array< bool > _flags
 
bool _useEpilogue2
 
int _loadGameSlot
 
bool _canLoadSave
 
bool _showOriginalSavesDialog
 
bool _interactiveFl
 
bool _isScreenDoubled
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Protected Member Functions

virtual void initialize ()
 Does basic initialization of the game engine. More...
 
virtual void showOpening ()=0
 
virtual void startScene ()
 
bool hasFeature (EngineFeature f) const override
 Returns a list of features the game itself supports. More...
 
virtual void loadConfig ()
 Load game configuration esttings. 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...
 

Private Member Functions

void sceneLoop ()
 Main loop for displaying a scene and handling all that occurs within it. More...
 
void handleInput ()
 Handle all player input. 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...
 
- Protected Attributes inherited from Engine
Common::TimerManager_timer
 
Common::EventManager_eventMan
 
Common::SaveFileManager_saveFileMan
 
GUI::Dialog_mainMenuDialog
 
const Common::String _targetName
 

Detailed Description

Definition at line 81 of file sherlock.h.

Constructor & Destructor Documentation

◆ SherlockEngine()

Sherlock::SherlockEngine::SherlockEngine ( OSystem syst,
const SherlockGameDescription gameDesc 
)

Definition at line 31 of file sherlock.cpp.

◆ ~SherlockEngine()

Sherlock::SherlockEngine::~SherlockEngine ( )
override

Definition at line 62 of file sherlock.cpp.

Member Function Documentation

◆ canLoadGameStateCurrently()

bool Sherlock::SherlockEngine::canLoadGameStateCurrently ( )
overridevirtual

Returns true if a savegame can be loaded.

Reimplemented from Engine.

Reimplemented in Sherlock::Tattoo::TattooEngine.

Definition at line 269 of file sherlock.cpp.

◆ canSaveGameStateCurrently()

bool Sherlock::SherlockEngine::canSaveGameStateCurrently ( )
overridevirtual

Returns true if the game can be saved.

Reimplemented from Engine.

Reimplemented in Sherlock::Tattoo::TattooEngine.

Definition at line 273 of file sherlock.cpp.

◆ getGameID()

GameType Sherlock::SherlockEngine::getGameID ( ) const

Returns the Id of the game.

Definition at line 39 of file detection.cpp.

◆ getLanguage()

Common::Language Sherlock::SherlockEngine::getLanguage ( ) const

Return the game's language.

Definition at line 47 of file detection.cpp.

◆ getPlatform()

Common::Platform Sherlock::SherlockEngine::getPlatform ( ) const

Returns the platform the game's datafiles are for.

Definition at line 43 of file detection.cpp.

◆ getRandomNumber()

int Sherlock::SherlockEngine::getRandomNumber ( int  limit)
inline

Return a random number.

Definition at line 200 of file sherlock.h.

◆ handleInput()

void Sherlock::SherlockEngine::handleInput ( )
private

Handle all player input.

Definition at line 195 of file sherlock.cpp.

◆ hasFeature()

bool Sherlock::SherlockEngine::hasFeature ( EngineFeature  f) const
overrideprotectedvirtual

Returns a list of features the game itself supports.

Reimplemented from Engine.

Definition at line 227 of file detection.cpp.

◆ initialize()

void Sherlock::SherlockEngine::initialize ( )
protectedvirtual

Does basic initialization of the game engine.

Reimplemented in Sherlock::Scalpel::ScalpelEngine, and Sherlock::Tattoo::TattooEngine.

Definition at line 81 of file sherlock.cpp.

◆ isDemo()

bool Sherlock::SherlockEngine::isDemo ( ) const
virtual

Returns whether the version is a demo.

Definition at line 234 of file detection.cpp.

◆ loadConfig()

void Sherlock::SherlockEngine::loadConfig ( )
protectedvirtual

Load game configuration esttings.

Reimplemented in Sherlock::Tattoo::TattooEngine.

Definition at line 224 of file sherlock.cpp.

◆ loadGameState()

Common::Error Sherlock::SherlockEngine::loadGameState ( int  slot)
overridevirtual

Called by the GMM to load a savegame.

Reimplemented from Engine.

Definition at line 277 of file sherlock.cpp.

◆ readFlags()

bool Sherlock::SherlockEngine::readFlags ( int  flagNum)

Read the state of a global flag.

Remarks
If a negative value is specified, it will return the inverse value of the positive flag number

Definition at line 206 of file sherlock.cpp.

◆ run()

Common::Error Sherlock::SherlockEngine::run ( )
overridevirtual

Main method for running the game.

Implements Engine.

Definition at line 123 of file sherlock.cpp.

◆ saveConfig()

void Sherlock::SherlockEngine::saveConfig ( )
virtual

Saves game configuration information.

Reimplemented in Sherlock::Tattoo::TattooEngine.

Definition at line 239 of file sherlock.cpp.

◆ saveGameState()

Common::Error Sherlock::SherlockEngine::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 282 of file sherlock.cpp.

◆ sceneLoop()

void Sherlock::SherlockEngine::sceneLoop ( )
private

Main loop for displaying a scene and handling all that occurs within it.

Definition at line 172 of file sherlock.cpp.

◆ setFlags()

void Sherlock::SherlockEngine::setFlags ( int  flagNum)

Sets a global flag to either true or false depending on whether the specified flag is positive or negative.

Definition at line 214 of file sherlock.cpp.

◆ setFlagsDirect()

void Sherlock::SherlockEngine::setFlagsDirect ( int  flagNum)

Set a global flag to 0 or 1 depending on whether the passed flag is negative or positive.

Remarks
We don't use the global setFlags method because we don't want to check scene flags

Definition at line 220 of file sherlock.cpp.

◆ showOpening()

virtual void Sherlock::SherlockEngine::showOpening ( )
protectedpure virtual

◆ startScene()

virtual void Sherlock::SherlockEngine::startScene ( )
inlineprotectedvirtual

Reimplemented in Sherlock::Scalpel::ScalpelEngine, and Sherlock::Tattoo::TattooEngine.

Definition at line 101 of file sherlock.h.

◆ synchronize()

void Sherlock::SherlockEngine::synchronize ( Serializer s)

Synchronize the data for a savegame.

Definition at line 264 of file sherlock.cpp.

◆ syncSoundSettings()

void Sherlock::SherlockEngine::syncSoundSettings ( )
overridevirtual

Called by the engine when sound settings are updated.

Reimplemented from Engine.

Definition at line 256 of file sherlock.cpp.

Member Data Documentation

◆ _animation

Animation* Sherlock::SherlockEngine::_animation

Definition at line 114 of file sherlock.h.

◆ _canLoadSave

bool Sherlock::SherlockEngine::_canLoadSave

Definition at line 134 of file sherlock.h.

◆ _debugger

Debugger* Sherlock::SherlockEngine::_debugger

Definition at line 115 of file sherlock.h.

◆ _events

Events* Sherlock::SherlockEngine::_events

Definition at line 116 of file sherlock.h.

◆ _fixedText

FixedText* Sherlock::SherlockEngine::_fixedText

Definition at line 117 of file sherlock.h.

◆ _flags

Common::Array<bool> Sherlock::SherlockEngine::_flags

Definition at line 131 of file sherlock.h.

◆ _gameDescription

const SherlockGameDescription* Sherlock::SherlockEngine::_gameDescription

Definition at line 113 of file sherlock.h.

◆ _interactiveFl

bool Sherlock::SherlockEngine::_interactiveFl

Definition at line 136 of file sherlock.h.

◆ _inventory

Inventory* Sherlock::SherlockEngine::_inventory

Definition at line 118 of file sherlock.h.

◆ _isScreenDoubled

bool Sherlock::SherlockEngine::_isScreenDoubled

Definition at line 137 of file sherlock.h.

◆ _journal

Journal* Sherlock::SherlockEngine::_journal

Definition at line 119 of file sherlock.h.

◆ _loadGameSlot

int Sherlock::SherlockEngine::_loadGameSlot

Definition at line 133 of file sherlock.h.

◆ _map

Map* Sherlock::SherlockEngine::_map

Definition at line 120 of file sherlock.h.

◆ _music

Music* Sherlock::SherlockEngine::_music

Definition at line 121 of file sherlock.h.

◆ _people

People* Sherlock::SherlockEngine::_people

Definition at line 122 of file sherlock.h.

◆ _randomSource

Common::RandomSource Sherlock::SherlockEngine::_randomSource

Definition at line 130 of file sherlock.h.

◆ _res

Resources* Sherlock::SherlockEngine::_res

Definition at line 123 of file sherlock.h.

◆ _saves

SaveManager* Sherlock::SherlockEngine::_saves

Definition at line 124 of file sherlock.h.

◆ _scene

Scene* Sherlock::SherlockEngine::_scene

Definition at line 125 of file sherlock.h.

◆ _screen

Screen* Sherlock::SherlockEngine::_screen

Definition at line 126 of file sherlock.h.

◆ _showOriginalSavesDialog

bool Sherlock::SherlockEngine::_showOriginalSavesDialog

Definition at line 135 of file sherlock.h.

◆ _sound

Sound* Sherlock::SherlockEngine::_sound

Definition at line 127 of file sherlock.h.

◆ _talk

Talk* Sherlock::SherlockEngine::_talk

Definition at line 128 of file sherlock.h.

◆ _ui

UserInterface* Sherlock::SherlockEngine::_ui

Definition at line 129 of file sherlock.h.

◆ _useEpilogue2

bool Sherlock::SherlockEngine::_useEpilogue2

Definition at line 132 of file sherlock.h.


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