mirror of
https://bitbucket.org/Mattrixwv/projecteulercpp.git
synced 2025-12-06 17:13:59 -05:00
Changed function access
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user