aboutsummaryrefslogtreecommitdiff
path: root/engines/pink/objects/walk
diff options
context:
space:
mode:
Diffstat (limited to 'engines/pink/objects/walk')
-rw-r--r--engines/pink/objects/walk/walk_location.cpp29
-rw-r--r--engines/pink/objects/walk/walk_location.h42
-rw-r--r--engines/pink/objects/walk/walk_mgr.cpp20
-rw-r--r--engines/pink/objects/walk/walk_mgr.h46
4 files changed, 137 insertions, 0 deletions
diff --git a/engines/pink/objects/walk/walk_location.cpp b/engines/pink/objects/walk/walk_location.cpp
new file mode 100644
index 0000000000..e5f5ea7535
--- /dev/null
+++ b/engines/pink/objects/walk/walk_location.cpp
@@ -0,0 +1,29 @@
+/* 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 "walk_location.h"
+#include "engines/pink/archive.h"
+
+void Pink::WalkLocation::deserialize(Pink::Archive &archive) {
+ NamedObject::deserialize(archive);
+ archive >> _neighbors;
+}
diff --git a/engines/pink/objects/walk/walk_location.h b/engines/pink/objects/walk/walk_location.h
new file mode 100644
index 0000000000..82e6436b77
--- /dev/null
+++ b/engines/pink/objects/walk/walk_location.h
@@ -0,0 +1,42 @@
+/* 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 PINK_WALK_LOCATION_H
+#define PINK_WALK_LOCATION_H
+
+#include <engines/pink/objects/object.h>
+#include <common/array.h>
+#include <common/str-array.h>
+
+
+namespace Pink {
+
+class WalkLocation : public NamedObject {
+public:
+ virtual void deserialize(Archive &archive);
+
+private:
+ Common::StringArray _neighbors;
+};
+
+} // End of namespace Pink
+
+#endif \ No newline at end of file
diff --git a/engines/pink/objects/walk/walk_mgr.cpp b/engines/pink/objects/walk/walk_mgr.cpp
new file mode 100644
index 0000000000..1b5ceef210
--- /dev/null
+++ b/engines/pink/objects/walk/walk_mgr.cpp
@@ -0,0 +1,20 @@
+//
+// Created by andrei on 3/17/18.
+//
+
+#include "walk_mgr.h"
+#include "walk_location.h"
+#include "engines/pink/objects/actors/lead_actor.h"
+#include "engines/pink/archive.h"
+
+
+void Pink::WalkMgr::deserialize(Pink::Archive &archive) {
+ _leadActor = static_cast<LeadActor*>(archive.readObject());
+ archive >> _locations;
+}
+
+Pink::WalkLocation *Pink::WalkMgr::findLocation(Common::String &name) {
+ return *Common::find_if(_locations.begin(), _locations.end(), [&name] (WalkLocation *location) {
+ return location->getName() == name;
+ });
+}
diff --git a/engines/pink/objects/walk/walk_mgr.h b/engines/pink/objects/walk/walk_mgr.h
new file mode 100644
index 0000000000..0ae7ef6194
--- /dev/null
+++ b/engines/pink/objects/walk/walk_mgr.h
@@ -0,0 +1,46 @@
+/* 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 PINK_WALK_MGR_H
+#define PINK_WALK_MGR_H
+
+#include <common/array.h>
+#include "engines/pink/objects/object.h"
+
+namespace Pink {
+
+class WalkLocation;
+class LeadActor;
+
+class WalkMgr : public Object {
+public:
+ virtual void deserialize(Archive &archive);
+ WalkLocation *findLocation(Common::String &name);
+
+private:
+ LeadActor *_leadActor;
+ Common::Array<WalkLocation*> _locations;
+};
+
+} // End of namespace Pink
+
+#endif