ScummVM
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 ()
 
virtual bool hasFeature (EngineFeature f) const
 Determine whether the engine supports the specified feature. More...
 
virtual Common::Error run ()
 Init the engine and start its main loop. More...
 
bool canLoadGameStateCurrently ()
 Indicates whether a game state can be loaded. More...
 
bool canSaveGameStateCurrently ()
 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 ()
 
virtual Common::Error loadGameState (int slot)
 Load a game state. More...
 
virtual Common::Error saveGameState (int slot, const Common::String &description)
 Save a game state. More...
 
bool scummVMSaveLoadDialog (bool isSave)
 
virtual GUI::DebuggergetDebugger ()
 Return the engine's debugger instance, if any. More...
 
- Public Member Functions inherited from Engine
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...
 
 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 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 initKeymap ()
 
virtual void deinitKeymap ()
 
virtual void flipMute ()
 Flip mute all sound option. More...
 
void setGameToLoadSlot (int slot)
 Sets the game slot for a savegame to be loaded after global main menu execution. More...
 

Public Attributes

Common::RandomSource_rnd
 
Debugger_debugger
 
Gui_gui
 
World_world
 
Scene_lastScene
 
int _loopCount
 
int _turn
 
Chr_monster
 
Chr_running
 
Obj_offer
 
int _aim
 
int _opponentAim
 
bool _temporarilyHidden
 
bool _isGameOver
 
bool _commandWasQuick
 
bool _shouldQuit
 
Common::String _inputText
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

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)
 
Common::String getSavegameFilename (int16 slotId) const
 

Private Attributes

Console_console
 
const ADGameDescription_gameDescription
 
Common::MacResManager_resManager
 
Audio::SoundHandle _soundHandle
 

Friends

class Dialog
 

Additional Inherited Members

- Public Types inherited from Engine
enum  EngineFeature {
  kSupportsSubtitleOptions, kSupportsRTL, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime,
  kSupportsJoystick
}
 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 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)
 
bool shouldPerformAutoSave (int lastSaveTime)
 Indicate whether an autosave should be performed. More...
 
virtual void pauseEngineIntern (bool pause)
 Actual implementation of pauseEngine by subclasses. 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 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 95 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 209 of file wage.cpp.

◆ attackHit()

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

Definition at line 254 of file combat.cpp.

◆ canLoadGameStateCurrently()

bool Wage::WageEngine::canLoadGameStateCurrently ( )
virtual

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 158 of file detection.cpp.

◆ canSaveGameStateCurrently()

bool Wage::WageEngine::canSaveGameStateCurrently ( )
virtual

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 162 of file detection.cpp.

◆ decrementUses()

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

Definition at line 234 of file combat.cpp.

◆ doClose()

void Wage::WageEngine::doClose ( )
private

Definition at line 328 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 219 of file wage.cpp.

◆ getChrById()

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

Definition at line 119 of file saveload.cpp.

◆ getChrByOffset()

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

Definition at line 129 of file saveload.cpp.

◆ getDebugger()

virtual GUI::Debugger* Wage::WageEngine::getDebugger ( )
inlinevirtual

Return the engine's debugger instance, if any.

Used by error() to invoke the debugger when a severe error is reported.

Reimplemented from Engine.

Definition at line 232 of file wage.h.

◆ 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
private

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.

◆ getSavegameFilename()

Common::String Wage::WageEngine::getSavegameFilename ( int16  slotId) const
private

Definition at line 724 of file saveload.cpp.

◆ getSceneById()

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

Definition at line 143 of file saveload.cpp.

◆ getSceneByName()

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

Definition at line 332 of file wage.cpp.

◆ getSceneByOffset()

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

Definition at line 153 of file saveload.cpp.

◆ getSceneIndex()

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

Definition at line 94 of file saveload.cpp.

◆ getTargetName()

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

Definition at line 130 of file wage.h.

◆ getValidMoveDirections()

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

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
virtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 89 of file detection.cpp.

◆ loadGame()

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

Definition at line 378 of file saveload.cpp.

◆ loadGameState()

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

Load a game state.

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

Reimplemented from Engine.

Definition at line 730 of file saveload.cpp.

◆ loadWorld()

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

◆ onMove()

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

Definition at line 343 of file wage.cpp.

◆ performAttack()

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

Definition at line 182 of file combat.cpp.

◆ performCombatAction()

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

Definition at line 101 of file combat.cpp.

◆ performHealingMagic()

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

Definition at line 359 of file combat.cpp.

◆ performInitialSetup()

void Wage::WageEngine::performInitialSetup ( )
private

Definition at line 260 of file wage.cpp.

◆ performMagic()

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

Definition at line 346 of file combat.cpp.

◆ performMove()

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

Definition at line 402 of file combat.cpp.

◆ performOffer()

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

Definition at line 436 of file combat.cpp.

◆ performTake()

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

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 158 of file wage.cpp.

◆ processTurn()

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

Definition at line 470 of file wage.cpp.

◆ processTurnInternal()

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

Definition at line 409 of file wage.cpp.

◆ redrawScene()

void Wage::WageEngine::redrawScene ( )

Definition at line 398 of file wage.cpp.

◆ regen()

void Wage::WageEngine::regen ( )

Definition at line 479 of file combat.cpp.

◆ run()

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

Init the engine and start its main loop.

Returns
returns kNoError on success, else an error code.

Implements Engine.

Definition at line 106 of file wage.cpp.

◆ saveDialog()

bool Wage::WageEngine::saveDialog ( )

Definition at line 234 of file wage.cpp.

◆ saveGame() [1/2]

void Wage::WageEngine::saveGame ( )

Definition at line 256 of file wage.cpp.

◆ saveGame() [2/2]

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

Definition at line 171 of file saveload.cpp.

◆ saveGameState()

Common::Error Wage::WageEngine::saveGameState ( int  slot,
const Common::String desc 
)
virtual

Save a game state.

Parameters
slotthe slot into which the savestate should be stored
desca description for the savestate, entered by the user
Returns
returns kNoError on success, else an error code.

Reimplemented from Engine.

Definition at line 737 of file saveload.cpp.

◆ scummVMSaveLoadDialog()

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

Definition at line 745 of file saveload.cpp.

◆ setMenu()

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

Definition at line 203 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 
)
private

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)
private

Definition at line 323 of file wage.cpp.

Friends And Related Function Documentation

◆ Dialog

friend class Dialog
friend

Definition at line 114 of file wage.h.

Member Data Documentation

◆ _aim

int Wage::WageEngine::_aim

Definition at line 191 of file wage.h.

◆ _commandWasQuick

bool Wage::WageEngine::_commandWasQuick

Definition at line 195 of file wage.h.

◆ _console

Console* Wage::WageEngine::_console
private

Definition at line 235 of file wage.h.

◆ _debugger

Debugger* Wage::WageEngine::_debugger

Definition at line 180 of file wage.h.

◆ _gameDescription

const ADGameDescription* Wage::WageEngine::_gameDescription
private

Definition at line 237 of file wage.h.

◆ _gui

Gui* Wage::WageEngine::_gui

Definition at line 182 of file wage.h.

◆ _inputText

Common::String Wage::WageEngine::_inputText

Definition at line 199 of file wage.h.

◆ _isGameOver

bool Wage::WageEngine::_isGameOver

Definition at line 194 of file wage.h.

◆ _lastScene

Scene* Wage::WageEngine::_lastScene

Definition at line 185 of file wage.h.

◆ _loopCount

int Wage::WageEngine::_loopCount

Definition at line 186 of file wage.h.

◆ _monster

Chr* Wage::WageEngine::_monster

Definition at line 188 of file wage.h.

◆ _offer

Obj* Wage::WageEngine::_offer

Definition at line 190 of file wage.h.

◆ _opponentAim

int Wage::WageEngine::_opponentAim

Definition at line 192 of file wage.h.

◆ _resManager

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

Definition at line 239 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 189 of file wage.h.

◆ _shouldQuit

bool Wage::WageEngine::_shouldQuit

Definition at line 197 of file wage.h.

◆ _soundHandle

Audio::SoundHandle Wage::WageEngine::_soundHandle
private

Definition at line 241 of file wage.h.

◆ _temporarilyHidden

bool Wage::WageEngine::_temporarilyHidden

Definition at line 193 of file wage.h.

◆ _turn

int Wage::WageEngine::_turn

Definition at line 187 of file wage.h.

◆ _world

World* Wage::WageEngine::_world

Definition at line 183 of file wage.h.


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