Changeset 345 for trunk/Map.pas
- Timestamp:
- Dec 23, 2024, 11:25:36 AM (9 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Map.pas
r343 r345 48 48 Extra: TExtraType; 49 49 OneUnitId: Integer; // Temporary value 50 function Compare(Cell: TCell): Boolean; 50 51 procedure ConnectTo(Cell: TCell); 51 52 procedure DisconnectFrom(Cell: TCell); … … 80 81 procedure LoadFromNode(Node: TDOMNode); 81 82 procedure SaveToNode(Node: TDOMNode); 83 function Compare(Cells: TCells): Boolean; 82 84 procedure ClearMark; 83 85 procedure ClearWeight; … … 409 411 end; 410 412 413 function TCells.Compare(Cells: TCells): Boolean; 414 var 415 I: Integer; 416 begin 417 Result := True; 418 for I := 0 to Count - 1 do 419 with Items[I] do begin 420 if not Items[I].Compare(Cells[I]) then begin 421 Result := False; 422 Break; 423 end; 424 end; 425 end; 426 411 427 procedure TCells.ClearMark; 412 428 var … … 543 559 function TMap.Compare(Map: TMap): Boolean; 544 560 begin 545 Result := True; 561 Result := (MaxPower = Map.MaxPower) and 562 (Cyclic = Map.Cyclic) and 563 (Size = Map.Size) and 564 (DefaultCellSize = Map.DefaultCellSize) and 565 (Shape = Map.Shape) and 566 Cells.Compare(Map.Cells); 546 567 end; 547 568 … … 942 963 end; 943 964 965 function TCell.Compare(Cell: TCell): Boolean; 966 begin 967 Result := (Id = Cell.Id) and 968 (PosPx = Cell.PosPx) and 969 (Terrain = Cell.Terrain) and 970 Polygon.Compare(Cell.Polygon) and 971 (Player = Cell.Player) and 972 (Mark = Cell.Mark) and 973 (Extra = Cell.Extra); 974 end; 975 944 976 procedure TCell.ConnectTo(Cell: TCell); 945 977 begin
Note:
See TracChangeset
for help on using the changeset viewer.