#include "abstractWatchMode.h" #include "stopWatchMode.h" stopWatch::stopWatch (): clockObject () { this->active = false; } stopWatch::~stopWatch () { } void stopWatch::enable (bool active) { this->active = active; } bool stopWatch::isEnabled () { return active; } void stopWatch::pulse () { if (!active) { return; } sec++; if (sec >= 60) { sec = 0; min++; if (min >= 60) { min = 0; hour++; if (hour >= 24) { hour = 0; } } } } void stopWatch::reset () { hour = 0; min = 0; sec = 0; }