From d0bbee4c25b4a0e17926261c8a242ff97e3d6b74 Mon Sep 17 00:00:00 2001 From: Olly Date: Sat, 23 Sep 2023 16:47:58 +0100 Subject: [PATCH] Move boxarray to unit --- Source/algorithms/simba.algo_sort.pas | 1 - .../imports/simba/simba.import_boxarray.pas | 3 ++- Source/{boxarray.inc => simba.boxarray.pas} | 26 +++++++++++++++---- Source/simba.mufasatypes.pas | 2 -- 4 files changed, 23 insertions(+), 9 deletions(-) rename Source/{boxarray.inc => simba.boxarray.pas} (95%) diff --git a/Source/algorithms/simba.algo_sort.pas b/Source/algorithms/simba.algo_sort.pas index 46b126a68..3620b1581 100644 --- a/Source/algorithms/simba.algo_sort.pas +++ b/Source/algorithms/simba.algo_sort.pas @@ -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} diff --git a/Source/script/imports/simba/simba.import_boxarray.pas b/Source/script/imports/simba/simba.import_boxarray.pas index 5fd76ca67..067a084c1 100644 --- a/Source/script/imports/simba/simba.import_boxarray.pas +++ b/Source/script/imports/simba/simba.import_boxarray.pas @@ -14,6 +14,7 @@ implementation uses lptypes, + simba.boxarray, simba.algo_difference, simba.algo_intersection, simba.algo_symmetricDifference; (* @@ -270,4 +271,4 @@ procedure ImportBoxArray(Compiler: TSimbaScript_Compiler); end; end; -end. \ No newline at end of file +end. diff --git a/Source/boxarray.inc b/Source/simba.boxarray.pas similarity index 95% rename from Source/boxarray.inc rename to Source/simba.boxarray.pas index 55c7edda3..50c6b7c9d 100644 --- a/Source/boxarray.inc +++ b/Source/simba.boxarray.pas @@ -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 @@ -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; @@ -306,6 +322,6 @@ function TBoxArrayHelper.Sort(Weights: TDoubleArray; LowToHigh: Boolean): TBoxAr begin Result := specialize Sorted(Self, Weights, LowToHigh); end; -{$ENDIF} +end. diff --git a/Source/simba.mufasatypes.pas b/Source/simba.mufasatypes.pas index 1f260a708..56878883b 100644 --- a/Source/simba.mufasatypes.pas +++ b/Source/simba.mufasatypes.pas @@ -339,7 +339,6 @@ TCircle = record {$DEFINE HEADER} {$i generics.inc} {$i box.inc} - {$i boxarray.inc} {$i point.inc} {$i string.inc} @@ -431,7 +430,6 @@ implementation {$DEFINE BODY} {$i generics.inc} {$i box.inc} - {$i boxarray.inc} {$i point.inc} {$i string.inc}