Changeset 7 for trunk/class


Ignore:
Timestamp:
Nov 22, 2012, 7:09:17 AM (11 years ago)
Author:
chronos
Message:
  • Added: Allow terminate solving process.
  • Fixed: Disable actions which can change maze during solving.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        33Lazes.lps
        44Lazes.dbg
         5Lazes
  • trunk/class/maze.pas

    r1 r7  
    8383
    8484    procedure ResetTags(const pValue: integer = 0);
     85    procedure ResetState;
    8586    function  GetCell(const pPosition: TCellPoint): TMazeCell;
    8687    function  StartCell: TMazeCell;
     
    211212
    212213procedure TMaze.ResetTags(const pValue: integer);
    213 var row,col: integer;
     214var
     215  row,col: integer;
    214216begin
    215217  for row := 0 to Height-1 do
    216218    for col := 0 to Width-1 do
    217       FMaze[row][col].Tag := pValue
     219      FMaze[row][col].Tag := pValue;
     220end;
     221
     222procedure TMaze.ResetState;
     223var
     224  row,col: integer;
     225begin
     226  for row := 0 to Height - 1 do
     227    for col := 0 to Width - 1 do
     228      FMaze[row, col].State := csEmpty;
    218229end;
    219230
  • trunk/class/mazepainter.pas

    r6 r7  
    7070constructor TMazePainter.Create(const pMaze: TMaze; pCanvas: TCanvas);
    7171begin
     72  Bmp := TBitMap.Create;
     73
    7274  // Init the default drawing width and height
    7375  FCellDrawWidth := 15;
     
    9193destructor TMazePainter.Destroy;
    9294begin
    93   bmp.Free;
     95  FreeAndNil(Bmp);
    9496  inherited Destroy;
    9597end;
     
    122124  if isDirty then
    123125  begin
    124     //FreeAndNil(bmp);
    125     //bmp := TBitMap.Create;
    126126    bmp.SetSize(Width + 1, Height + 1);
    127127    Canvas := bmp.Canvas;
Note: See TracChangeset for help on using the changeset viewer.