aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/moves
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-27 18:29:16 -0400
committerPaul Gilbert2016-08-27 18:29:16 -0400
commit311006c84cd85897cb9c536e948bc6f5d36b3805 (patch)
treee1e33b74090a7abfda909d964b8e25c769e42f9b /engines/titanic/moves
parent1694680acea712db0149c74de412e309dbd0c1cc (diff)
downloadscummvm-rg350-311006c84cd85897cb9c536e948bc6f5d36b3805.tar.gz
scummvm-rg350-311006c84cd85897cb9c536e948bc6f5d36b3805.tar.bz2
scummvm-rg350-311006c84cd85897cb9c536e948bc6f5d36b3805.zip
TITANIC: Implemented restaurant related game classes
Diffstat (limited to 'engines/titanic/moves')
-rw-r--r--engines/titanic/moves/restaurant_pan_handler.cpp30
-rw-r--r--engines/titanic/moves/restaurant_pan_handler.h13
2 files changed, 31 insertions, 12 deletions
diff --git a/engines/titanic/moves/restaurant_pan_handler.cpp b/engines/titanic/moves/restaurant_pan_handler.cpp
index 92f55b46cc..d93e331254 100644
--- a/engines/titanic/moves/restaurant_pan_handler.cpp
+++ b/engines/titanic/moves/restaurant_pan_handler.cpp
@@ -24,24 +24,40 @@
namespace Titanic {
-int CRestaurantPanHandler::_v1;
+BEGIN_MESSAGE_MAP(CRestaurantPanHandler, CMovePlayerTo)
+ ON_MESSAGE(ArmPickedUpFromTableMsg)
+ ON_MESSAGE(MouseButtonDownMsg)
+END_MESSAGE_MAP()
+
+bool CRestaurantPanHandler::_armPickedUp;
void CRestaurantPanHandler::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
- file->writeNumberLine(_v1, indent);
- file->writeQuotedLine(_string1, indent);
- file->writeQuotedLine(_string2, indent);
+ file->writeNumberLine(_armPickedUp, indent);
+ file->writeQuotedLine(_armlessDestination, indent);
+ file->writeQuotedLine(_armDestination, indent);
CMovePlayerTo::save(file, indent);
}
void CRestaurantPanHandler::load(SimpleFile *file) {
file->readNumber();
- _v1 = file->readNumber();
- _string1 = file->readString();
- _string2 = file->readString();
+ _armPickedUp = file->readNumber();
+ _armlessDestination = file->readString();
+ _armDestination = file->readString();
CMovePlayerTo::load(file);
}
+bool CRestaurantPanHandler::ArmPickedUpFromTableMsg(CArmPickedUpFromTableMsg *msg) {
+ _armPickedUp = true;
+ return true;
+}
+
+bool CRestaurantPanHandler::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+ _destination = _armPickedUp ? _armDestination : _armlessDestination;
+ changeView(_destination);
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/moves/restaurant_pan_handler.h b/engines/titanic/moves/restaurant_pan_handler.h
index 4925aa685b..745cd5d564 100644
--- a/engines/titanic/moves/restaurant_pan_handler.h
+++ b/engines/titanic/moves/restaurant_pan_handler.h
@@ -28,11 +28,14 @@
namespace Titanic {
class CRestaurantPanHandler : public CMovePlayerTo {
-protected:
- static int _v1;
-
- CString _string1;
- CString _string2;
+ DECLARE_MESSAGE_MAP;
+ bool ArmPickedUpFromTableMsg(CArmPickedUpFromTableMsg *msg);
+ bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+private:
+ CString _armDestination;
+ CString _armlessDestination;
+public:
+ static bool _armPickedUp;
public:
CLASSDEF;