last works ...
This commit is contained in:
@@ -3268,6 +3268,70 @@ bool AddIfNotExists(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
int FillNotExists(
|
||||
T &dest[],
|
||||
T &source[],
|
||||
ENUM_X_DIRECTION forDir = X_DIRECTION_NONE,
|
||||
int maxAllowed = 0 //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
// Prepare ...
|
||||
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;
|
||||
}
|
||||
//+------------------------------------------------------------------+
|
||||
|
||||
//+------------------------------------------------------------------+
|
||||
@@ -4774,9 +4838,9 @@ bool ToResistanceBox(
|
||||
|
||||
/**
|
||||
* Remove Breaked Zones from a Collection ...
|
||||
*
|
||||
*
|
||||
* @param source: XBoxZone, reference to Specified Collection ...
|
||||
*
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
int RemoveBreakedZones(XBoxZone &source[])
|
||||
@@ -5465,7 +5529,6 @@ int ExtractBreakeds(
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Collect all Bars which Breakes Specified Zone ...
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user