Hi. I would like help on undoing and redoing using the memento design pattern. I want to save a state that a board is in. Like a chessboard. If the user uses the undo option a previous board should be loaded and all of the states that the pieces was in. And the redo option should redo a previous move. I'm in quite a hurry to finish this project. This is about all I still have to do. Any help or suggestions on how to do it would be appreciated.
I forgot to mention that the undo choice may only be used once, and the redo as well.
This code might help you to help me... :) I'm not that good in C++(or programming for that matter), so if there are dumb mistakes, please tell me about it.
It is so simple to say it, but I struggle with programming. Sorry for the lines and lines of code, but please look through it and tell me if I'm at least in the right direction. And if you may, point out where improvements can be made or code be taken out.
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...