aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/pet_control/pet_control.cpp11
-rw-r--r--engines/titanic/pet_control/pet_control.h11
2 files changed, 22 insertions, 0 deletions
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index a5885502f0..c7dc8d2c21 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -354,4 +354,15 @@ void CPetControl::displayMessage(const CString &msg) {
error("TODO: CPetControl::displayMessage");
}
+CGameObject *CPetControl::getFirstObject() const {
+ return static_cast<CGameObject *>(getFirstChild());
+}
+
+CGameObject *CPetControl::getNextObject(CGameObject *prior) const {
+ if (!prior || prior->getParent() != this)
+ return nullptr;
+
+ return static_cast<CGameObject *>(prior->getNextSibling());
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 401f5de3b9..c22f555c31 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -201,6 +201,17 @@ public:
* Display a message
*/
void displayMessage(const CString &msg);
+
+ /**
+ * Get the first game object stored in the PET
+ */
+ CGameObject *getFirstObject() const;
+
+ /**
+ * Get the next game object stored in the PET following
+ * the passed game object
+ */
+ CGameObject *getNextObject(CGameObject *prior) const;
};
} // End of namespace Titanic