aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/messages/messages.h
diff options
context:
space:
mode:
authorPaul Gilbert2017-08-06 11:58:06 -0400
committerPaul Gilbert2017-08-06 11:58:06 -0400
commit07e70d9896c0d2eb9c2b1c56becfa1483822a382 (patch)
treec280946cbce939f10f47705dfce71da153cd4b6e /engines/titanic/messages/messages.h
parentf5b335af100c84d2ad761548825548d6fe3be125 (diff)
downloadscummvm-rg350-07e70d9896c0d2eb9c2b1c56becfa1483822a382.tar.gz
scummvm-rg350-07e70d9896c0d2eb9c2b1c56becfa1483822a382.tar.bz2
scummvm-rg350-07e70d9896c0d2eb9c2b1c56becfa1483822a382.zip
TITANIC: Create new CMovementMsg for new movement functionality
This also moves logic for detecting which movement is associated with given keycodes and cursors to CMovementMsg and CLinkItem, which are better suited to contain the logic
Diffstat (limited to 'engines/titanic/messages/messages.h')
-rw-r--r--engines/titanic/messages/messages.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 8f8c785e43..b5c8dd4e21 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -222,6 +222,32 @@ enum MissiveOMatAction {
MESSAGE_STARTUP = 9
};
+enum Movement {
+ MOVE_NONE = 0, MOVE_FORWARDS, MOVE_BACKWARDS, TURN_LEFT, TURN_RIGHT
+};
+
+
+class CMovementMsg : public CMessage {
+public:
+ Movement _movement;
+public:
+ CLASSDEF;
+ CMovementMsg() : _movement(MOVE_NONE) {}
+ CMovementMsg(Movement move) : _movement(move) {}
+ CMovementMsg(Common::KeyCode key) :
+ _movement(getMovement(key)) {}
+
+ static bool isSupportedBy(const CTreeItem *item) {
+ return supports(item, _type);
+ }
+
+ /**
+ * Returns the movement associated with a given key, if any
+ */
+ static Movement getMovement(Common::KeyCode keycode);
+};
+
+
MESSAGE1(CActMsg, CString, action, "");
MESSAGE1(CActivationmsg, CString, value, "");
MESSAGE1(CAddHeadPieceMsg, CString, value, "NULL");