aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/carry
diff options
context:
space:
mode:
authorPaul Gilbert2016-02-29 22:56:16 -0500
committerPaul Gilbert2016-02-29 22:56:16 -0500
commit5dd3798ebf8177d9c21d79d4e36b173568c09a70 (patch)
tree54c691106c1c6a9d94d1c36164083162765e9eb4 /engines/titanic/carry
parenta89dd72f2007b00304d0cc01ac4b6dc08ed6625e (diff)
downloadscummvm-rg350-5dd3798ebf8177d9c21d79d4e36b173568c09a70.tar.gz
scummvm-rg350-5dd3798ebf8177d9c21d79d4e36b173568c09a70.tar.bz2
scummvm-rg350-5dd3798ebf8177d9c21d79d4e36b173568c09a70.zip
TITANIC: Added a bunch of classes, loading method fixes
Diffstat (limited to 'engines/titanic/carry')
-rw-r--r--engines/titanic/carry/hose.cpp14
-rw-r--r--engines/titanic/carry/hose.h11
-rw-r--r--engines/titanic/carry/hose_end.cpp43
-rw-r--r--engines/titanic/carry/hose_end.h52
-rw-r--r--engines/titanic/carry/perch.cpp37
-rw-r--r--engines/titanic/carry/perch.h50
6 files changed, 206 insertions, 1 deletions
diff --git a/engines/titanic/carry/hose.cpp b/engines/titanic/carry/hose.cpp
index bb52ec34d5..1617feffc1 100644
--- a/engines/titanic/carry/hose.cpp
+++ b/engines/titanic/carry/hose.cpp
@@ -24,18 +24,32 @@
namespace Titanic {
+CHoseStatics *CHose::_statics;
+
+void CHose::init() {
+ _statics = new CHoseStatics();
+}
+
+void CHose::deinit() {
+ delete _statics;
+}
+
CHose::CHose() : CCarry(),
_string6("Succ-U-Bus auxiliary hose attachment incompatible with sliding glass cover.") {
}
void CHose::save(SimpleFile *file, int indent) const {
file->writeNumberLine(1, indent);
+ file->writeNumberLine(_statics->_v1, indent);
+ file->writeQuotedLine(_statics->_v2, indent);
file->writeQuotedLine(_string6, indent);
CCarry::save(file, indent);
}
void CHose::load(SimpleFile *file) {
file->readNumber();
+ _statics->_v1 = file->readNumber();
+ _statics->_v2 = file->readString();
_string6 = file->readString();
CCarry::load(file);
}
diff --git a/engines/titanic/carry/hose.h b/engines/titanic/carry/hose.h
index 87f47b3bc4..dc60f6832f 100644
--- a/engines/titanic/carry/hose.h
+++ b/engines/titanic/carry/hose.h
@@ -27,11 +27,20 @@
namespace Titanic {
+struct CHoseStatics {
+ int _v1;
+ CString _v2;
+};
+
class CHose : public CCarry {
-private:
+protected:
+ static CHoseStatics *_statics;
+
CString _string6;
public:
CHose();
+ static void init();
+ static void deinit();
/**
* Return the class name
diff --git a/engines/titanic/carry/hose_end.cpp b/engines/titanic/carry/hose_end.cpp
new file mode 100644
index 0000000000..97d75b0ac4
--- /dev/null
+++ b/engines/titanic/carry/hose_end.cpp
@@ -0,0 +1,43 @@
+/* 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ */
+
+#include "titanic/carry/hose_end.h"
+
+namespace Titanic {
+
+CHoseEnd::CHoseEnd() : CHose() {
+ _string6 = "Connection refused by remote hose.";
+}
+
+void CHoseEnd::save(SimpleFile *file, int indent) const {
+ file->writeNumberLine(1, indent);
+ file->writeQuotedLine(_string6, indent);
+ CHose::save(file, indent);
+}
+
+void CHoseEnd::load(SimpleFile *file) {
+ file->readNumber();
+ _string6 = file->readString();
+ CHose::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/hose_end.h b/engines/titanic/carry/hose_end.h
new file mode 100644
index 0000000000..efce6b8db0
--- /dev/null
+++ b/engines/titanic/carry/hose_end.h
@@ -0,0 +1,52 @@
+/* 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.
+ *
+ * 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.
+ *
+ * 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 TITANIC_HOSE_END_H
+#define TITANIC_HOSE_END_H
+
+#include "titanic/carry/hose.h"
+
+namespace Titanic {
+
+class CHoseEnd : public CHose {
+public:
+ CHoseEnd();
+
+ /**
+ * Return the class name
+ */
+ virtual const char *getClassName() const { return "CHoseEnd"; }
+
+ /**
+ * Save the data for the class to file
+ */
+ virtual void save(SimpleFile *file, int indent) const;
+
+ /**
+ * Load the data for the class from file
+ */
+ virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_HOSE_END_H */
diff --git a/engines/titanic/carry/perch.cpp b/engines/titanic/carry/perch.cpp
new file mode 100644
index 0000000000..976921beb0
--- /dev/null
+++ b/engines/titanic/carry/perch.cpp
@@ -0,0 +1,37 @@
+/* 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ */
+
+#include "titanic/carry/perch.h"
+
+namespace Titanic {
+
+void CPerch::save(SimpleFile *file, int indent) const {
+ file->writeNumberLine(1, indent);
+ CCentralCore::save(file, indent);
+}
+
+void CPerch::load(SimpleFile *file) {
+ file->readNumber();
+ CCentralCore::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/perch.h b/engines/titanic/carry/perch.h
new file mode 100644
index 0000000000..ce13dbe684
--- /dev/null
+++ b/engines/titanic/carry/perch.h
@@ -0,0 +1,50 @@
+/* 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.
+ *
+ * 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.
+ *
+ * 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 TITANIC_PERCH_H
+#define TITANIC_PERCH_H
+
+#include "titanic/carry/central_core.h"
+
+namespace Titanic {
+
+class CPerch : public CCentralCore {
+public:
+ /**
+ * Return the class name
+ */
+ virtual const char *getClassName() const { return "CPerch"; }
+
+ /**
+ * Save the data for the class to file
+ */
+ virtual void save(SimpleFile *file, int indent) const;
+
+ /**
+ * Load the data for the class from file
+ */
+ virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PERCH_H */