Changeset 167 for trunk/UGame.pas
- Timestamp:
- Nov 23, 2017, 9:57:48 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UGame.pas
r166 r167 188 188 private 189 189 FSize: TPoint; 190 FUpdateCount: Integer;191 190 function GetSize: TPoint; virtual; 192 191 procedure PaintCell(Canvas: TCanvas; Pos: TPoint; Text: string; View: TView; … … 229 228 procedure CreateLinks; 230 229 procedure Clear; 231 procedure BeginUpdate;232 procedure EndUpdate;233 230 constructor Create; virtual; 234 231 destructor Destroy; override; … … 1388 1385 if (FSize.X <> AValue.X) or (FSize.Y <> AValue.Y) then begin 1389 1386 FSize := AValue; 1390 if FUpdateCount = 0 then Generate;1391 1387 end; 1392 1388 end; … … 1504 1500 // I: Integer; 1505 1501 begin 1506 FUpdateCount := Source.FUpdateCount;1507 1502 MaxPower := Source.MaxPower; 1508 1503 Game := Source.Game; … … 1784 1779 Cells.Clear; 1785 1780 FNewCellId := 1; 1786 end;1787 1788 procedure TMap.BeginUpdate;1789 begin1790 Inc(FUpdateCount);1791 end;1792 1793 procedure TMap.EndUpdate;1794 begin1795 if FUpdateCount > 0 then Dec(FUpdateCount);1796 if FUpdateCount = 0 then Generate;1797 1781 end; 1798 1782 … … 3317 3301 begin 3318 3302 with Config do begin 3319 try 3320 Map.BeginUpdate; 3321 MapType := TMapType(GetValue(DOMString(Path + '/GridType'), Integer(mtHexagon))); 3322 Map.Size := Point(GetValue(DOMString(Path + '/MapSizeX'), 10), 3323 GetValue(DOMString(Path + '/MapSizeY'), 10)); 3324 finally 3325 Map.EndUpdate; 3326 end; 3303 MapType := TMapType(GetValue(DOMString(Path + '/GridType'), Integer(mtHexagon))); 3304 Map.Size := Point(GetValue(DOMString(Path + '/MapSizeX'), 10), 3305 GetValue(DOMString(Path + '/MapSizeY'), 10)); 3327 3306 MapImageFileName := string(GetValue(DOMString(Path + '/MapImage'), DOMString(MapImageFileName))); 3328 3307 SymetricMap := GetValue(DOMString(Path + '/SymetricMap'), False);
Note:
See TracChangeset
for help on using the changeset viewer.