summaryrefslogtreecommitdiff
path: root/gameObject.cpp
diff options
context:
space:
mode:
authorroot <root@bpcserver.bpcserver>2024-02-27 21:53:44 -0600
committerroot <root@bpcserver.bpcserver>2024-02-27 21:53:44 -0600
commitafa02f645056c5823b0d8a29d37c1ff10aedce7a (patch)
tree0bc89e7909c17d8f33538ac9f31a641872b89f40 /gameObject.cpp
Diffstat (limited to 'gameObject.cpp')
-rw-r--r--gameObject.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/gameObject.cpp b/gameObject.cpp
new file mode 100644
index 0000000..bfb7616
--- /dev/null
+++ b/gameObject.cpp
@@ -0,0 +1,29 @@
+#include "city.h"
+
+// Programmer: Brett Weiland
+// Date: 4/30/23
+// File: gameObject.h
+// Assignment: SP-B-finalProject
+// Purpose: member functions shared between all city participants.
+
+void gameObject::includeInMap(city *parent_city, coordinate starting_pos) {
+ parentCity = parent_city; //TODO change name
+ location = starting_pos;
+}
+
+gameObject *gameObject::get_top() const { return top_obj; }
+gameObject *gameObject::get_bottom() const { return bottom_obj; }
+void gameObject::set_top(gameObject *top) { top_obj = top; }
+void gameObject::set_bottom(gameObject *bottom) { bottom_obj = bottom; }
+bool gameObject::is_attached() const { return attached_to_map; }
+
+void gameObject::mapAttach() {
+ attached_to_map = true;
+ parentCity->addMapMarker(*this);
+}
+void gameObject::mapDetach() {
+ attached_to_map = false;
+ parentCity->delMapMarker(*this);
+}
+
+coordinate gameObject::getLocation() const { return location; }