2011-06-27 17:09:55 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2014-02-18 02:34:22 +01:00
|
|
|
*
|
2011-06-27 17:09:55 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2014-02-18 02:34:22 +01:00
|
|
|
*
|
2011-06-27 17:09:55 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef NEVERHOOD_GAMEMODULE_H
|
|
|
|
#define NEVERHOOD_GAMEMODULE_H
|
|
|
|
|
|
|
|
#include "neverhood/neverhood.h"
|
|
|
|
#include "neverhood/module.h"
|
|
|
|
|
|
|
|
namespace Neverhood {
|
|
|
|
|
|
|
|
class GameModule : public Module {
|
|
|
|
public:
|
|
|
|
GameModule(NeverhoodEngine *vm);
|
|
|
|
virtual ~GameModule();
|
2011-07-27 18:02:30 +00:00
|
|
|
void startup();
|
2013-01-23 11:24:17 +00:00
|
|
|
void requestRestoreGame();
|
2013-01-22 12:13:34 +00:00
|
|
|
void requestRestartGame(bool requestMainMenu);
|
2013-01-23 11:24:17 +00:00
|
|
|
void redrawPrevChildObject();
|
|
|
|
void checkRequests();
|
2011-07-11 12:21:56 +00:00
|
|
|
void handleMouseMove(int16 x, int16 y);
|
2011-07-07 20:26:12 +00:00
|
|
|
void handleMouseDown(int16 x, int16 y);
|
2012-10-12 19:19:24 +00:00
|
|
|
void handleMouseUp(int16 x, int16 y);
|
2014-01-06 14:47:17 +01:00
|
|
|
void handleWheelUp();
|
|
|
|
void handleWheelDown();
|
2012-10-11 21:23:55 +00:00
|
|
|
void handleSpaceKey();
|
2012-10-27 22:18:54 +00:00
|
|
|
void handleAsciiKey(char key);
|
|
|
|
void handleKeyDown(Common::KeyCode keyCode);
|
|
|
|
void handleEscapeKey();
|
2012-10-18 17:15:20 +00:00
|
|
|
void initKeySlotsPuzzle();
|
|
|
|
void initMemoryPuzzle();
|
|
|
|
void initWaterPipesPuzzle();
|
|
|
|
void initRadioPuzzle();
|
|
|
|
void initTestTubes1Puzzle();
|
2013-07-14 19:01:47 +02:00
|
|
|
void initTestTubes2Puzzle();
|
2012-10-18 17:15:20 +00:00
|
|
|
void initCannonSymbolsPuzzle();
|
2012-11-13 13:19:49 +00:00
|
|
|
void initCodeSymbolsPuzzle();
|
2012-11-14 12:21:13 +00:00
|
|
|
void initCubeSymbolsPuzzle();
|
2013-01-17 10:04:17 +00:00
|
|
|
void initCrystalColorsPuzzle();
|
2012-10-18 17:15:20 +00:00
|
|
|
uint32 getCurrRadioMusicFileHash();
|
2013-06-09 16:07:45 +03:00
|
|
|
int getCurrentModuleNum() { return _moduleNum; }
|
|
|
|
int getPreviousModuleNum() { return _moduleNum; }
|
|
|
|
|
|
|
|
void createModule(int moduleNum, int which);
|
2011-06-27 17:09:55 +00:00
|
|
|
protected:
|
2013-01-29 11:57:06 +00:00
|
|
|
int _moduleNum;
|
2011-06-27 17:09:55 +00:00
|
|
|
Entity *_prevChildObject;
|
2012-10-19 13:55:37 +00:00
|
|
|
int _prevModuleNum;
|
2013-01-23 11:24:17 +00:00
|
|
|
bool _restoreGameRequested;
|
2013-01-22 12:13:34 +00:00
|
|
|
bool _restartGameRequested;
|
2013-01-29 11:00:49 +00:00
|
|
|
bool _canRequestMainMenu;
|
2012-10-19 13:55:37 +00:00
|
|
|
bool _mainMenuRequested;
|
2011-06-27 17:09:55 +00:00
|
|
|
uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender);
|
2012-10-15 15:50:43 +00:00
|
|
|
void createModuleByHash(uint32 nameHash);
|
2011-09-19 13:16:41 +00:00
|
|
|
void updateModule();
|
2012-10-19 13:55:37 +00:00
|
|
|
void openMainMenu();
|
|
|
|
void createMenuModule();
|
|
|
|
void updateMenuModule();
|
2011-06-27 17:09:55 +00:00
|
|
|
};
|
|
|
|
|
2012-10-20 20:57:46 +00:00
|
|
|
class NonRepeatingRandomNumbers : public Common::Array<int> {
|
2012-10-20 20:10:23 +00:00
|
|
|
public:
|
|
|
|
NonRepeatingRandomNumbers(Common::RandomSource *rnd, int count);
|
|
|
|
int getNumber();
|
2012-10-20 20:57:46 +00:00
|
|
|
void removeNumber(int number);
|
2012-10-20 20:10:23 +00:00
|
|
|
protected:
|
|
|
|
Common::RandomSource *_rnd;
|
|
|
|
};
|
|
|
|
|
2011-06-27 17:09:55 +00:00
|
|
|
} // End of namespace Neverhood
|
|
|
|
|
|
|
|
#endif /* NEVERHOOD_MODULE_H */
|