Skip to content

Commit

Permalink
Move boxarray to unit
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Sep 23, 2023
1 parent bfcd61d commit d0bbee4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
1 change: 0 additions & 1 deletion Source/algorithms/simba.algo_sort.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Project: Simba (https://github.com/MerlijnWajer/Simba)
License: GNU General Public License (https://www.gnu.org/licenses/gpl-3.0)
}

unit simba.algo_sort;

{$DEFINE SIMBA_MAX_OPTIMIZATION}
Expand Down
3 changes: 2 additions & 1 deletion Source/script/imports/simba/simba.import_boxarray.pas
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ implementation

uses
lptypes,
simba.boxarray,
simba.algo_difference, simba.algo_intersection, simba.algo_symmetricDifference;

(*
Expand Down Expand Up @@ -270,4 +271,4 @@ procedure ImportBoxArray(Compiler: TSimbaScript_Compiler);
end;
end;

end.
end.
26 changes: 21 additions & 5 deletions Source/boxarray.inc → Source/simba.boxarray.pas
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{%MAINUNIT simba.mufasatypes}
{
Author: Raymond van Venetië and Merlijn Wajer
Project: Simba (https://github.com/MerlijnWajer/Simba)
License: GNU General Public License (https://www.gnu.org/licenses/gpl-3.0)
}
unit simba.boxarray;

{$i simba.inc}

interface

uses
Classes, SysUtils,
simba.mufasatypes;

{$IFDEF HEADER}
type
TBoxArrayHelper = type helper for TBoxArray
public
Expand Down Expand Up @@ -28,9 +40,13 @@
function Expand(SizeMod: Integer): TBoxArray; overload;
function Expand(WidMod, HeiMod: Integer): TBoxArray; overload;
end;
{$ENDIF}

{$IFDEF BODY}
implementation

uses
Math,
simba.math, simba.algo_sort;

class function TBoxArrayHelper.Create(Start: TPoint; Columns, Rows, Width, Height: Int32; Spacing: TPoint): TBoxArray;
var
I: Int32;
Expand Down Expand Up @@ -306,6 +322,6 @@ function TBoxArrayHelper.Sort(Weights: TDoubleArray; LowToHigh: Boolean): TBoxAr
begin
Result := specialize Sorted<TBox, Double>(Self, Weights, LowToHigh);
end;
{$ENDIF}

end.

2 changes: 0 additions & 2 deletions Source/simba.mufasatypes.pas
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ TCircle = record
{$DEFINE HEADER}
{$i generics.inc}
{$i box.inc}
{$i boxarray.inc}
{$i point.inc}
{$i string.inc}

Expand Down Expand Up @@ -431,7 +430,6 @@ implementation
{$DEFINE BODY}
{$i generics.inc}
{$i box.inc}
{$i boxarray.inc}
{$i point.inc}
{$i string.inc}

Expand Down

0 comments on commit d0bbee4

Please sign in to comment.