diff options
author | Paul Gilbert | 2016-08-13 09:52:44 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-13 09:52:44 -0400 |
commit | 5c64e27692f041c231e08575d03642b4873c887e (patch) | |
tree | 5d099f3b09304c9dea7aa37f5b5f47292dd8eb8b /engines/titanic/npcs/robot_controller.cpp | |
parent | c270b30a7937186fecd016b9a74421d633dd90c0 (diff) | |
download | scummvm-rg350-5c64e27692f041c231e08575d03642b4873c887e.tar.gz scummvm-rg350-5c64e27692f041c231e08575d03642b4873c887e.tar.bz2 scummvm-rg350-5c64e27692f041c231e08575d03642b4873c887e.zip |
TITANIC: Implemented several NPC related game classes
Diffstat (limited to 'engines/titanic/npcs/robot_controller.cpp')
-rw-r--r-- | engines/titanic/npcs/robot_controller.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/engines/titanic/npcs/robot_controller.cpp b/engines/titanic/npcs/robot_controller.cpp index 98866e4505..34c75e30eb 100644 --- a/engines/titanic/npcs/robot_controller.cpp +++ b/engines/titanic/npcs/robot_controller.cpp @@ -24,21 +24,37 @@ namespace Titanic { -CRobotController::CRobotController() : CGameObject(), _string1("BellBot") { +BEGIN_MESSAGE_MAP(CRobotController, CGameObject) + ON_MESSAGE(SummonBotMsg) + ON_MESSAGE(SummonBotQueryMsg) +END_MESSAGE_MAP() + +CRobotController::CRobotController() : CGameObject(), _robotName("BellBot") { } void CRobotController::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeQuotedLine(_string1, indent); + file->writeQuotedLine(_robotName, indent); CGameObject::save(file, indent); } void CRobotController::load(SimpleFile *file) { file->readNumber(); - _string1 = file->readString(); + _robotName = file->readString(); CGameObject::load(file); } +bool CRobotController::SummonBotMsg(CSummonBotMsg *msg) { + if (!petDismissBot(msg->_npcName)) + petOnSummonBot(msg->_npcName, msg->_value); + + return true; +} + +bool CRobotController::SummonBotQueryMsg(CSummonBotQueryMsg *msg) { + return _robotName == msg->_npcName; +} + } // End of namespace Titanic |