blob: bfb761615cb1076b3b806a3cf16f8276d609f66b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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; }
|