From afa02f645056c5823b0d8a29d37c1ff10aedce7a Mon Sep 17 00:00:00 2001 From: root Date: Tue, 27 Feb 2024 21:53:44 -0600 Subject: init --- gameObject.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 gameObject.cpp (limited to 'gameObject.cpp') 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; } -- cgit v1.2.3