Quote (NamelessPrince @ Apr 11 2013 11:14pm)
The whole point is that I need to make multiple puzzle types, Clock, Water, Pogo, Etc, and the Solver method calls methods from Clock or Water, etc to create the solution.
explain this part a little better.
So far i'm not seeing anything that requires generics. just have Puzzle with an abstract solve() and have each subclass override solve() to do the solution.
if there is a lot of duplicate code, create a second wrapper method
eg:
abstract void solveImpl();
void solve(){
// start up, prompt user, etc
solveImpl();
// show message, clear the screen, etc
}
where each subclass overrides solveImpl()
Either way, ignore Clock for now and just write Puzzle completely. the whole point of a super class or generics is that you don't need to know the subclasses ahead of time. the logic should just work regardless
This post was edited by carteblanche on Apr 11 2013 09:20pm