#include #include "BucketT.h" #include "GameConstants.h" using namespace std; BucketT::BucketT(){ cherryCount = 0; return; } void BucketT::AddCherries(int n){ cherryCount += n; if (cherryCount > MAX_CHERRIES) { cherryCount = MAX_CHERRIES; } if (cherryCount < 0) { cherryCount = 0; } return; } void BucketT::SubtractCherries(int n){ AddCherries(-n); return; } int BucketT::Dump(){ int tmp = cherryCount; cherryCount = 0; return tmp; } int BucketT::GetCherryCount(){ return cherryCount; }