Changed function access

This commit is contained in:
2021-07-05 01:56:22 -04:00
parent a1a7938281
commit e48731df26

View File

@@ -34,6 +34,12 @@ protected:
const std::string description; //Holds the description of the problem const std::string description; //Holds the description of the problem
mee::Stopwatch timer; //Used to determine your algorithm's run time mee::Stopwatch timer; //Used to determine your algorithm's run time
bool solved; //Holds true after the problem has been solved bool solved; //Holds true after the problem has been solved
//Make sure the problem has been solved and throw an exception if not
void solvedCheck(std::string str) const{
if(!solved){
throw new Unsolved("You must solve the problem before you can see the " + str);
}
}
public: public:
//Constructors //Constructors
Problem() : solved(false){ Problem() : solved(false){
@@ -68,11 +74,6 @@ public:
timer.reset(); timer.reset();
solved = false; solved = false;
} }
void solvedCheck(std::string str) const{
if(!solved){
throw new Unsolved("You must solve the problem before you can see the " + str);
}
}
//Pure virtual functions //Pure virtual functions
//Solve the problem //Solve the problem
virtual void solve() = 0; virtual void solve() = 0;