diff options
Diffstat (limited to 'gameObject.cpp')
-rw-r--r-- | gameObject.cpp | 29 |
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; } |