summaryrefslogtreecommitdiff
path: root/jewl.cpp
blob: 1be4d22970698606e5a8e28d501840cb855548e9 (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
#include "jewl.h"    
#include "coordinate.h"
#include "city.h"

// Programmer: Brett Weiland
// Date: 4/30/23
// File: jewl.hpp
// Assignment: SP-B-finalProject
// Purpose: contains member functions for jewl; see jewl.h

char jewl::getIcon() const { return 'j'; }

unsigned int jewl::get_drawPriority() const { return 2; }

unsigned int jewl::value() const { return location.get_x() + location.get_y(); }

void jewl::drop() {
  mapAttach();
  parentCity->markJewlAvailable(*this); 
}

unsigned int jewl::pickup() {
  mapDetach();
  parentCity->markJewlTaken(*this); 
  return value();
}