aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/game/cookie.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-18 22:45:58 -0400
committerPaul Gilbert2016-08-18 22:45:58 -0400
commitdc91d30b76ded7ed7a648a0b0b43d8fe99c00cf6 (patch)
tree12e445180f88ffdd5f9ad0a200f1b9c39faa6180 /engines/titanic/game/cookie.cpp
parentdf5f78037cc33fb63bdb5233a8ed378db77d9832 (diff)
downloadscummvm-rg350-dc91d30b76ded7ed7a648a0b0b43d8fe99c00cf6.tar.gz
scummvm-rg350-dc91d30b76ded7ed7a648a0b0b43d8fe99c00cf6.tar.bz2
scummvm-rg350-dc91d30b76ded7ed7a648a0b0b43d8fe99c00cf6.zip
TITANIC: Implementing game classes
Diffstat (limited to 'engines/titanic/game/cookie.cpp')
-rw-r--r--engines/titanic/game/cookie.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/engines/titanic/game/cookie.cpp b/engines/titanic/game/cookie.cpp
index 915bb93b4a..96edca4058 100644
--- a/engines/titanic/game/cookie.cpp
+++ b/engines/titanic/game/cookie.cpp
@@ -24,6 +24,11 @@
namespace Titanic {
+BEGIN_MESSAGE_MAP(CCookie, CGameObject)
+ ON_MESSAGE(LeaveNodeMsg)
+ ON_MESSAGE(FreshenCookieMsg)
+END_MESSAGE_MAP()
+
void CCookie::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_value1, indent);
@@ -40,4 +45,16 @@ void CCookie::load(SimpleFile *file) {
CGameObject::load(file);
}
+bool CCookie::LeaveNodeMsg(CLeaveNodeMsg *msg) {
+ if (_value2)
+ _value1 = 1;
+ return true;
+}
+
+bool CCookie::FreshenCookieMsg(CFreshenCookieMsg *msg) {
+ _value1 = msg->_value2;
+ _value2 = msg->_value1;
+ return true;
+}
+
} // End of namespace Titanic