Changeset 345
- Timestamp:
- Dec 23, 2024, 11:25:36 AM (4 hours ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GameSystem.pas
r344 r345 143 143 (UnitsSplitMerge = GameSystem.UnitsSplitMerge) and 144 144 (EmptyCellsNeutral = GameSystem.EmptyCellsNeutral) and 145 (PreferedMapType = GameSystem.PreferedMapType) ; //and146 //(UnitKinds.Assign(GameSystem.UnitKinds) and147 //(BuildingKinds.Assign(GameSystem.BuildingKinds) and148 //(Nations.Assign(GameSystem.Nations);145 (PreferedMapType = GameSystem.PreferedMapType) and 146 UnitKinds.Compare(GameSystem.UnitKinds) and 147 BuildingKinds.Compare(GameSystem.BuildingKinds) and 148 Nations.Compare(GameSystem.Nations); 149 149 end; 150 150 -
trunk/Geometry.pas
r317 r345 96 96 constructor Create(const Points: TPointArray); overload; 97 97 constructor Create(const Rect: TGRect<T>); overload; 98 function Compare(Polygon: TGPolygon<T>): Boolean; 98 99 procedure Move(P: T); 99 100 function GetRect: TGRect<T>; … … 239 240 Self.Points[2] := Rect.P2; 240 241 Self.Points[3] := T.Create(Rect.P1.X, Rect.P2.Y); 242 end; 243 244 function TGPolygon<T>.Compare(Polygon: TGPolygon<T>): Boolean; 245 var 246 I: Integer; 247 begin 248 Result := Length(Points) = Length(Polygon.Points); 249 if not Result then Exit; 250 for I := 0 to Length(Points) - 1 do 251 if Points[I] <> Polygon.Points[I] then begin 252 Result := False; 253 Break; 254 end; 241 255 end; 242 256 -
trunk/ItemList.pas
r344 r345 253 253 end; 254 254 255 function TItemList<T>.QueryInterface(constref iid: tguid; out obj): longint;255 function TItemList<T>.QueryInterface(constref iid: tguid; out obj): LongInt; 256 256 stdcall; 257 257 begin 258 end; 259 260 function TItemList<T>._AddRef: Longint; stdcall; 261 begin 262 end; 263 264 function TItemList<T>._Release: Longint; stdcall; 265 begin 258 Result := 0; 259 end; 260 261 function TItemList<T>._AddRef: LongInt; stdcall; 262 begin 263 Result := 0; 264 end; 265 266 function TItemList<T>._Release: LongInt; stdcall; 267 begin 268 Result := 0; 266 269 end; 267 270 -
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.