From afa02f645056c5823b0d8a29d37c1ff10aedce7a Mon Sep 17 00:00:00 2001 From: root Date: Tue, 27 Feb 2024 21:53:44 -0600 Subject: init --- cop.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 cop.h (limited to 'cop.h') diff --git a/cop.h b/cop.h new file mode 100644 index 0000000..2b46fb9 --- /dev/null +++ b/cop.h @@ -0,0 +1,48 @@ +#ifndef COP_H +#define COP_H + +// Programmer: Brett Weiland +// Date: 4/30/23 +// File: cop.h +// Assignment: SP-B-finalProject +// Purpose: defines cop npc which arrests robbers and takes money on contact. +// cops will also release robbers if bribed (see robbers.h). + +template +class robber; + +template +class cop : public npc { + private: + unsigned int robbers_caught = 0; + public: + //overrides; see relevant files for descriptions + void move() override; //npc.h + char getIcon() const override; //gameObject.h + unsigned int get_drawPriority() const override; //gameObject.h + + //getters and setters + unsigned int get_robbersCaught() const; + + //Desc: notifies all previously arrested robbers are now active, set robbers_caught to 0. + //Pre: none + //Post: none + void robbersReleased(); + + //Desc: arrests robber, calls robbers getArrested() function. + // takes all robbers inventory for self. + //Pre: active robber is passed + //Post: robber is arrested + void arrest(robber &offender); + + //Desc: robber calls this when they want to give us a bribe. + // Take an inventory item for ourselves, release all robbers. + //Pre: Item is passed as bribe + //Post: bribe is put into inventory, all robbers released. Robber not arrested as a result. + void takeBribe(T *bribe); + +}; + +#include "cop.hpp" + +#endif -- cgit v1.2.3