Last Works on XSDT Pivot Detector ...

This commit is contained in:
2026-08-14 03:30:03 +03:30
parent d50eef35bc
commit 9d23e2cba1
3 changed files with 1381 additions and 0 deletions
@@ -3482,6 +3482,74 @@ int FillNotExists(
//
return result;
}
template <typename T>
int FillNotExists(
T &dest[],
T &source[],
bool forceClean = false,
ENUM_X_DIRECTION forDir = X_DIRECTION_NONE,
int maxAllowed = 0 //
)
{
//
int result = 0;
//
// Prepare ...
if (forceClean)
{
XClean(dest);
}
//
// Normalize ...
maxAllowed = NormalizeInt(maxAllowed, 0);
//
// Validate ...
bool has = HasChild(source);
if (!has)
{
return result;
}
//
int count = ArraySize(source);
for (int i = 0; i < count; i++)
{
//
has =
source[i].IsValid() &&
(!HasDirection(forDir) || forDir == source[i].dir);
if (!has)
{
continue;
}
//
has = AddIfNotExists(source[i], dest);
if (has)
{
result++;
}
}
//
// Handle Cleanup Collection
// if Max Reached ...
if (maxAllowed > 0)
{
//
CleanupArray(
dest,
maxAllowed //
);
}
//
return result;
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+