Updated to use new solve checking function

This commit is contained in:
2021-07-14 15:38:06 -04:00
parent ad576cba19
commit 6e4dd45702

View File

@@ -55,18 +55,12 @@ public:
} }
//Get the time it took to run the algorithm as a string //Get the time it took to run the algorithm as a string
virtual std::string getTime(){ virtual std::string getTime(){
//If the problem hasn't been solved throw an exception solvedCheck("time it took to run the algorithm");
if(!solved){
throw Unsolved();
}
return timer.getStr(); return timer.getStr();
} }
//Get a copy of the timer that was used to time the algorithm //Get a copy of the timer that was used to time the algorithm
virtual mee::Stopwatch getTimer(){ virtual mee::Stopwatch getTimer(){
//If the problem hasn't been solved throw an exception solvedCheck("timer");
if(!solved){
throw Unsolved();
}
return timer; return timer;
} }
//Reset the problem so it can be run again //Reset the problem so it can be run again