Wage::WageEngine Class Reference

#include <wage.h>

+ Inheritance diagram for Wage::WageEngine:
+ Collaboration diagram for Wage::WageEngine:

Public Member Functions

 WageEngine (OSystem *syst, const ADGameDescription *gameDesc)
 ~WageEngine () override
bool hasFeature (EngineFeature f) const override
 Determine whether the engine supports the specified feature. More...
Common::Error run () override
 Init the engine and start its main loop. More...
bool canLoadGameStateCurrently () override
 Indicates whether a game state can be loaded. More...
bool canSaveGameStateCurrently () override
 Indicates whether a game state can be saved. More...
const char * getGameFile () const
void processTurn (Common::String *textInput, Designed *clickInput)
void regen ()
const char * getTargetName ()
void takeObj (Obj *obj)
bool handleMoveCommand (Directions dir, const char *dirName)
bool handleLookCommand ()
Common::StringgetGroundItemsList (Scene *scene)
void appendObjNames (Common::String &str, const ObjArray &objs)
bool handleInventoryCommand ()
bool handleStatusCommand ()
bool handleRestCommand ()
bool handleAcceptCommand ()
bool handleTakeCommand (const char *target)
bool handleDropCommand (const char *target)
bool handleAimCommand (const char *target)
bool handleWearCommand (const char *target)
bool handleOfferCommand (const char *target)
void wearObj (Obj *o, int pos)
bool tryAttack (const Obj *weapon, const Common::String &input)
bool handleAttack (Obj *weapon)
void printPlayerCondition (Chr *player)
const char * getPercentMessage (double percent)
void playSound (Common::String soundName)
void setMenu (Common::String soundName)
void appendText (const char *str)
void gameOver ()
bool saveDialog ()
ObjgetOffer ()
ChrgetMonster ()
void processEvents ()
ScenegetSceneByName (Common::String &location)
void onMove (Designed *what, Designed *from, Designed *to)
void encounter (Chr *player, Chr *chr)
void redrawScene ()
void saveGame ()
Common::Error loadGameState (int slot) override
 Load a game state. More...
Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false) override
 Save a game state. More...
bool scummVMSaveLoadDialog (bool isSave)
- 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 syncSoundSettings ()
 Notify the engine that the sound settings in the config manager may have changed and that it hence should adjust any internal volume etc. 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

int _loopCount
int _turn
int _aim
int _opponentAim
bool _temporarilyHidden
bool _isGameOver
bool _commandWasQuick
bool _shouldQuit
Common::String _inputText
- Public Attributes inherited from Engine

Private Member Functions

bool loadWorld (Common::MacResManager *resMan)
void performInitialSetup ()
void wearObjs (Chr *chr)
void processTurnInternal (Common::String *textInput, Designed *clickInput)
void performCombatAction (Chr *npc, Chr *player)
int getValidMoveDirections (Chr *npc)
void performAttack (Chr *attacker, Chr *victim, Obj *weapon)
void performMagic (Chr *attacker, Chr *victim, Obj *magicalObject)
void performMove (Chr *chr, int validMoves)
void performOffer (Chr *attacker, Chr *victim)
void performTake (Chr *npc, Obj *obj)
void decrementUses (Obj *obj)
bool attackHit (Chr *attacker, Chr *victim, Obj *weapon, int targetIndex)
void performHealingMagic (Chr *chr, Obj *magicalObject)
void doClose ()
void updateSoundTimerForScene (Scene *scene, bool firstTime)
int getSceneIndex (Scene *scene) const
ObjgetObjByOffset (int offset, int objBaseOffset) const
ChrgetChrById (int resId) const
ChrgetChrByOffset (int offset, int chrBaseOffset) const
ScenegetSceneById (int id) const
ScenegetSceneByOffset (int offset) const
int saveGame (const Common::String &fileName, const Common::String &descriptionString)
int loadGame (int slotId)

Private Attributes

const ADGameDescription_gameDescription
Audio::SoundHandle _soundHandle


class Dialog

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 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 inherited from Engine
const Common::String _targetName

Detailed Description

Definition at line 113 of file wage.h.

Constructor & Destructor Documentation

◆ WageEngine()

Wage::WageEngine::WageEngine ( OSystem syst,
const ADGameDescription gameDesc 

Definition at line 66 of file wage.cpp.

◆ ~WageEngine()

Wage::WageEngine::~WageEngine ( )

Definition at line 93 of file wage.cpp.

Member Function Documentation

◆ appendObjNames()

void Wage::WageEngine::appendObjNames ( Common::String str,
const ObjArray objs 

Definition at line 577 of file combat.cpp.

◆ appendText()

void Wage::WageEngine::appendText ( const char *  str)

Definition at line 196 of file wage.cpp.

◆ attackHit()

bool Wage::WageEngine::attackHit ( Chr attacker,
Chr victim,
Obj weapon,
int  targetIndex 

Definition at line 254 of file combat.cpp.

◆ canLoadGameStateCurrently()

bool Wage::WageEngine::canLoadGameStateCurrently ( )

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 157 of file detection.cpp.

◆ canSaveGameStateCurrently()

bool Wage::WageEngine::canSaveGameStateCurrently ( )

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 161 of file detection.cpp.

◆ decrementUses()

void Wage::WageEngine::decrementUses ( Obj obj)

Definition at line 234 of file combat.cpp.

◆ doClose()

void Wage::WageEngine::doClose ( )

Definition at line 315 of file wage.cpp.

◆ encounter()

void Wage::WageEngine::encounter ( Chr player,
Chr chr 

Definition at line 72 of file combat.cpp.

◆ gameOver()

void Wage::WageEngine::gameOver ( )

Definition at line 206 of file wage.cpp.

◆ getChrById()

Chr * Wage::WageEngine::getChrById ( int  resId) const

Definition at line 119 of file saveload.cpp.

◆ getChrByOffset()

Chr * Wage::WageEngine::getChrByOffset ( int  offset,
int  chrBaseOffset 
) const

Definition at line 129 of file saveload.cpp.

◆ getGameFile()

const char * Wage::WageEngine::getGameFile ( ) const

Definition at line 34 of file detection.cpp.

◆ getGroundItemsList()

Common::String * Wage::WageEngine::getGroundItemsList ( Scene scene)

Definition at line 562 of file combat.cpp.

◆ getMonster()

Chr * Wage::WageEngine::getMonster ( )

Definition at line 65 of file combat.cpp.

◆ getObjByOffset()

Obj * Wage::WageEngine::getObjByOffset ( int  offset,
int  objBaseOffset 
) const

Definition at line 105 of file saveload.cpp.

◆ getOffer()

Obj * Wage::WageEngine::getOffer ( )

Definition at line 55 of file combat.cpp.

◆ getPercentMessage()

const char * Wage::WageEngine::getPercentMessage ( double  percent)

Definition at line 891 of file combat.cpp.

◆ getSceneById()

Scene * Wage::WageEngine::getSceneById ( int  id) const

Definition at line 143 of file saveload.cpp.

◆ getSceneByName()

Scene * Wage::WageEngine::getSceneByName ( Common::String location)

Definition at line 319 of file wage.cpp.

◆ getSceneByOffset()

Scene * Wage::WageEngine::getSceneByOffset ( int  offset) const

Definition at line 153 of file saveload.cpp.

◆ getSceneIndex()

int Wage::WageEngine::getSceneIndex ( Scene scene) const

Definition at line 94 of file saveload.cpp.

◆ getTargetName()

const char* Wage::WageEngine::getTargetName ( )

Definition at line 130 of file wage.h.

◆ getValidMoveDirections()

int Wage::WageEngine::getValidMoveDirections ( Chr npc)

Definition at line 460 of file combat.cpp.

◆ handleAcceptCommand()

bool Wage::WageEngine::handleAcceptCommand ( )

Definition at line 677 of file combat.cpp.

◆ handleAimCommand()

bool Wage::WageEngine::handleAimCommand ( const char *  target)

Definition at line 739 of file combat.cpp.

◆ handleAttack()

bool Wage::WageEngine::handleAttack ( Obj weapon)

Definition at line 866 of file combat.cpp.

◆ handleDropCommand()

bool Wage::WageEngine::handleDropCommand ( const char *  target)

Definition at line 714 of file combat.cpp.

◆ handleInventoryCommand()

bool Wage::WageEngine::handleInventoryCommand ( )

Definition at line 600 of file combat.cpp.

◆ handleLookCommand()

bool Wage::WageEngine::handleLookCommand ( )

Definition at line 549 of file combat.cpp.

◆ handleMoveCommand()

bool Wage::WageEngine::handleMoveCommand ( Directions  dir,
const char *  dirName 

Definition at line 519 of file combat.cpp.

◆ handleOfferCommand()

bool Wage::WageEngine::handleOfferCommand ( const char *  target)

Definition at line 825 of file combat.cpp.

◆ handleRestCommand()

bool Wage::WageEngine::handleRestCommand ( )

Definition at line 665 of file combat.cpp.

◆ handleStatusCommand()

bool Wage::WageEngine::handleStatusCommand ( )

Definition at line 626 of file combat.cpp.

◆ handleTakeCommand()

bool Wage::WageEngine::handleTakeCommand ( const char *  target)

Definition at line 691 of file combat.cpp.

◆ handleWearCommand()

bool Wage::WageEngine::handleWearCommand ( const char *  target)

Definition at line 761 of file combat.cpp.

◆ hasFeature()

bool Wage::WageEngine::hasFeature ( EngineFeature  f) const

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 88 of file detection.cpp.

◆ loadGame()

int Wage::WageEngine::loadGame ( int  slotId)

Definition at line 378 of file saveload.cpp.

◆ loadGameState()

Common::Error Wage::WageEngine::loadGameState ( int  slot)

Load a game state.

slotthe slot from which a savestate should be loaded
returns kNoError on success, else an error code.

Reimplemented from Engine.

Definition at line 724 of file saveload.cpp.

◆ loadWorld()

bool Wage::WageEngine::loadWorld ( Common::MacResManager resMan)

◆ onMove()

void Wage::WageEngine::onMove ( Designed what,
Designed from,
Designed to 

Definition at line 330 of file wage.cpp.

◆ performAttack()

void Wage::WageEngine::performAttack ( Chr attacker,
Chr victim,
Obj weapon 

Definition at line 182 of file combat.cpp.

◆ performCombatAction()

void Wage::WageEngine::performCombatAction ( Chr npc,
Chr player 

Definition at line 101 of file combat.cpp.

◆ performHealingMagic()

void Wage::WageEngine::performHealingMagic ( Chr chr,
Obj magicalObject 

Definition at line 359 of file combat.cpp.

◆ performInitialSetup()

void Wage::WageEngine::performInitialSetup ( )

Definition at line 247 of file wage.cpp.

◆ performMagic()

void Wage::WageEngine::performMagic ( Chr attacker,
Chr victim,
Obj magicalObject 

Definition at line 346 of file combat.cpp.

◆ performMove()

void Wage::WageEngine::performMove ( Chr chr,
int  validMoves 

Definition at line 402 of file combat.cpp.

◆ performOffer()

void Wage::WageEngine::performOffer ( Chr attacker,
Chr victim 

Definition at line 436 of file combat.cpp.

◆ performTake()

void Wage::WageEngine::performTake ( Chr npc,
Obj obj 

Definition at line 449 of file combat.cpp.

◆ playSound()

void Wage::WageEngine::playSound ( Common::String  soundName)

Definition at line 83 of file sound.cpp.

◆ printPlayerCondition()

void Wage::WageEngine::printPlayerCondition ( Chr player)

Definition at line 907 of file combat.cpp.

◆ processEvents()

void Wage::WageEngine::processEvents ( )

Definition at line 150 of file wage.cpp.

◆ processTurn()

void Wage::WageEngine::processTurn ( Common::String textInput,
Designed clickInput 

Definition at line 457 of file wage.cpp.

◆ processTurnInternal()

void Wage::WageEngine::processTurnInternal ( Common::String textInput,
Designed clickInput 

Definition at line 396 of file wage.cpp.

◆ redrawScene()

void Wage::WageEngine::redrawScene ( )

Definition at line 385 of file wage.cpp.

◆ regen()

void Wage::WageEngine::regen ( )

Definition at line 479 of file combat.cpp.

◆ run()

Common::Error Wage::WageEngine::run ( )

Init the engine and start its main loop.

returns kNoError on success, else an error code.

Implements Engine.

Definition at line 103 of file wage.cpp.

◆ saveDialog()

bool Wage::WageEngine::saveDialog ( )

Definition at line 221 of file wage.cpp.

◆ saveGame() [1/2]

void Wage::WageEngine::saveGame ( )

Definition at line 243 of file wage.cpp.

◆ saveGame() [2/2]

int Wage::WageEngine::saveGame ( const Common::String fileName,
const Common::String descriptionString 

Definition at line 171 of file saveload.cpp.

◆ saveGameState()

Common::Error Wage::WageEngine::saveGameState ( int  slot,
const Common::String desc,
bool  isAutosave = false 

Save a game state.

slotthe slot into which the savestate should be stored
desca description for the savestate, entered by the user
isAutosaveExpected to be true if an autosave is being created
returns kNoError on success, else an error code.

Reimplemented from Engine.

Definition at line 731 of file saveload.cpp.

◆ scummVMSaveLoadDialog()

bool Wage::WageEngine::scummVMSaveLoadDialog ( bool  isSave)

Definition at line 739 of file saveload.cpp.

◆ setMenu()

void Wage::WageEngine::setMenu ( Common::String  soundName)

Definition at line 190 of file wage.cpp.

◆ takeObj()

void Wage::WageEngine::takeObj ( Obj obj)

Definition at line 491 of file combat.cpp.

◆ tryAttack()

bool Wage::WageEngine::tryAttack ( const Obj weapon,
const Common::String input 

Definition at line 855 of file combat.cpp.

◆ updateSoundTimerForScene()

void Wage::WageEngine::updateSoundTimerForScene ( Scene scene,
bool  firstTime 

Definition at line 117 of file sound.cpp.

◆ wearObj()

void Wage::WageEngine::wearObj ( Obj o,
int  pos 

Definition at line 805 of file combat.cpp.

◆ wearObjs()

void Wage::WageEngine::wearObjs ( Chr chr)

Definition at line 310 of file wage.cpp.

Friends And Related Function Documentation

◆ Dialog

friend class Dialog

Definition at line 114 of file wage.h.

Member Data Documentation

◆ _aim

int Wage::WageEngine::_aim

Definition at line 189 of file wage.h.

◆ _commandWasQuick

bool Wage::WageEngine::_commandWasQuick

Definition at line 193 of file wage.h.

◆ _gameDescription

const ADGameDescription* Wage::WageEngine::_gameDescription

Definition at line 228 of file wage.h.

◆ _gui

Gui* Wage::WageEngine::_gui

Definition at line 180 of file wage.h.

◆ _inputText

Common::String Wage::WageEngine::_inputText

Definition at line 197 of file wage.h.

◆ _isGameOver

bool Wage::WageEngine::_isGameOver

Definition at line 192 of file wage.h.

◆ _lastScene

Scene* Wage::WageEngine::_lastScene

Definition at line 183 of file wage.h.

◆ _loopCount

int Wage::WageEngine::_loopCount

Definition at line 184 of file wage.h.

◆ _monster

Chr* Wage::WageEngine::_monster

Definition at line 186 of file wage.h.

◆ _offer

Obj* Wage::WageEngine::_offer

Definition at line 188 of file wage.h.

◆ _opponentAim

int Wage::WageEngine::_opponentAim

Definition at line 190 of file wage.h.

◆ _resManager

Common::MacResManager* Wage::WageEngine::_resManager

Definition at line 230 of file wage.h.

◆ _rnd

Common::RandomSource* Wage::WageEngine::_rnd

Definition at line 178 of file wage.h.

◆ _running

Chr* Wage::WageEngine::_running

Definition at line 187 of file wage.h.

◆ _shouldQuit

bool Wage::WageEngine::_shouldQuit

Definition at line 195 of file wage.h.

◆ _soundHandle

Audio::SoundHandle Wage::WageEngine::_soundHandle

Definition at line 232 of file wage.h.

◆ _temporarilyHidden

bool Wage::WageEngine::_temporarilyHidden

Definition at line 191 of file wage.h.

◆ _turn

int Wage::WageEngine::_turn

Definition at line 185 of file wage.h.

◆ _world

World* Wage::WageEngine::_world

Definition at line 181 of file wage.h.

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