Rev 9 | Rev 11 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9 | Rev 10 | ||
---|---|---|---|
Line 60... | Line 60... | ||
60 | procedure MUndoClick(Sender: TObject); |
60 | procedure MUndoClick(Sender: TObject); |
61 | private |
61 | private |
62 | CountedSeconds: Integer; |
62 | CountedSeconds: Integer; |
63 | LevelFile: String; |
63 | LevelFile: String; |
64 | LookupFieldCoordinateArray: array of TPoint; |
64 | LookupFieldCoordinateArray: array of TPoint; |
65 | OriginalPlayGroundMatrix: TPlayGroundMatrix; |
- | |
66 | PrevPlaygroundMatrixes: array of TPlayGroundMatrix; |
65 | PrevPlaygroundMatrixes: array of TPlayGroundMatrix; |
67 | PlaygroundMatrix: TPlayGroundMatrix; |
66 | PlaygroundMatrix: TPlayGroundMatrix; |
68 | Points: Integer; |
67 | Points: Integer; |
69 | LevelTotalStones: Integer; |
68 | LevelTotalStones: Integer; |
70 | LevelRemovedStones: Integer; |
69 | LevelRemovedStones: Integer; |
Line 217... | Line 216... | ||
217 | RefreshStonesRemoved; |
216 | RefreshStonesRemoved; |
218 | 217 | ||
219 | JumpHistory.Clear; |
218 | JumpHistory.Clear; |
220 | 219 | ||
221 | ClearMatrix(PlayGroundMatrix, true); |
220 | ClearMatrix(PlayGroundMatrix, true); |
222 | ClearMatrix(OriginalPlayGroundMatrix, false); |
- | |
223 | for i := 0 to Length(PrevPlaygroundMatrixes)-1 do |
221 | for i := 0 to Length(PrevPlaygroundMatrixes)-1 do |
224 | ClearMatrix(PrevPlaygroundMatrixes[i], false); |
222 | ClearMatrix(PrevPlaygroundMatrixes[i], false); |
225 | SetLength(PrevPlaygroundMatrixes, 0); |
223 | SetLength(PrevPlaygroundMatrixes, 0); |
226 | MUndo.Enabled := false; |
224 | MUndo.Enabled := false; |
227 | 225 | ||
Line 611... | Line 609... | ||
611 | // Punkteanzeige unterschritten wurde, |
609 | // Punkteanzeige unterschritten wurde, |
612 | PlayGround.Left := ClientWidth div 2 - PlayGround.Width div 2; |
610 | PlayGround.Left := ClientWidth div 2 - PlayGround.Width div 2; |
613 | PlayGround.Top := ClientHeight div 2 - PlayGround.Height div 2; |
611 | PlayGround.Top := ClientHeight div 2 - PlayGround.Height div 2; |
614 | end; |
612 | end; |
615 | 613 | ||
616 | OriginalPlayGroundMatrix := CloneMatrix(PlayGroundMatrix); |
- | |
617 | SetLength(PrevPlaygroundMatrixes,1); |
614 | SetLength(PrevPlaygroundMatrixes,1); |
618 | PrevPlaygroundMatrixes[0] := CloneMatrix(PlayGroundMatrix); |
615 | PrevPlaygroundMatrixes[0] := CloneMatrix(PlayGroundMatrix); |
619 | MUndo.Enabled := false; |
616 | MUndo.Enabled := false; |
620 | end; |
617 | end; |
621 | 618 | ||
Line 723... | Line 720... | ||
723 | HistoryForm.JumpMemo.Lines.Assign(JumpHistory); |
720 | HistoryForm.JumpMemo.Lines.Assign(JumpHistory); |
724 | HistoryForm.ShowModal; |
721 | HistoryForm.ShowModal; |
725 | end; |
722 | end; |
726 | 723 | ||
727 | procedure TMainForm.RestartLevel; |
724 | procedure TMainForm.RestartLevel; |
- | 725 | var |
|
- | 726 | i: Integer; |
|
728 | begin |
727 | begin |
729 | MPauseTime.Enabled := false; |
728 | MPauseTime.Enabled := false; |
730 | Timer.Enabled := false; |
729 | Timer.Enabled := false; |
731 | 730 | ||
732 | MRestartGame.Enabled := false; |
731 | MRestartGame.Enabled := false; |
Line 740... | Line 739... | ||
740 | LevelRemovedStones := 0; |
739 | LevelRemovedStones := 0; |
741 | RefreshStonesRemoved; |
740 | RefreshStonesRemoved; |
742 | 741 | ||
743 | JumpHistory.Clear; |
742 | JumpHistory.Clear; |
744 | 743 | ||
745 | RedrawStonesFromMatrix(OriginalPlayGroundMatrix); |
744 | RedrawStonesFromMatrix(PrevPlaygroundMatrixes[0]); |
746 | SetNewPlayGroundMatrix(OriginalPlayGroundMatrix); |
745 | SetNewPlayGroundMatrix(PrevPlaygroundMatrixes[0]); |
- | 746 | for i := 1 to Length(PrevPlaygroundMatrixes)-1 do |
|
- | 747 | ClearMatrix(PrevPlaygroundMatrixes[i], false); |
|
747 | SetLength(PrevPlaygroundMatrixes,1); |
748 | SetLength(PrevPlaygroundMatrixes, 1); |
748 | PrevPlaygroundMatrixes[0] := CloneMatrix(OriginalPlayGroundMatrix); |
- | |
- | 749 | ||
749 | MUndo.Enabled := false; |
750 | MUndo.Enabled := false; |
750 | end; |
751 | end; |
751 | 752 | ||
752 | procedure TMainForm.SetNewPlayGroundMatrix(Matrix: TPlayGroundMatrix); |
753 | procedure TMainForm.SetNewPlayGroundMatrix(Matrix: TPlayGroundMatrix); |
753 | begin |
754 | begin |