From afa02f645056c5823b0d8a29d37c1ff10aedce7a Mon Sep 17 00:00:00 2001 From: root Date: Tue, 27 Feb 2024 21:53:44 -0600 Subject: init --- jewl.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 jewl.cpp (limited to 'jewl.cpp') diff --git a/jewl.cpp b/jewl.cpp new file mode 100644 index 0000000..1be4d22 --- /dev/null +++ b/jewl.cpp @@ -0,0 +1,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(); +} -- cgit v1.2.3