last works on XFIMA ...
This commit is contained in:
@@ -3493,6 +3493,66 @@ bool AddIfNotExists(
|
||||
}
|
||||
//+------------------------------------------------------------------+
|
||||
|
||||
//+------------------------------------------------------------------+
|
||||
//| Extract |
|
||||
//+------------------------------------------------------------------+
|
||||
|
||||
/**
|
||||
* Extract Specified Directional Items ...
|
||||
*
|
||||
* @param dest: reference collection to holds extracted items ...
|
||||
* @param source: reference collection to provides data source ...
|
||||
* @param forDir: Specified which direction to Extract items ...
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
template <typename T>
|
||||
int ExtractByDirection(
|
||||
T &dest[],
|
||||
T &source[],
|
||||
ENUM_X_DIRECTION forDir //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
// Prepare ...
|
||||
XClean(dest);
|
||||
|
||||
//
|
||||
// Validate ...
|
||||
bool has = HasChild(source) &&
|
||||
HasDirection(forDir);
|
||||
if (!has)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int count = ArraySize(source);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
has = source[i].dir == forDir;
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
source[i],
|
||||
dest //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(dest);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
//+------------------------------------------------------------------+
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
@@ -4255,11 +4315,11 @@ bool IsInside(
|
||||
|
||||
/**
|
||||
* Check a Bar is Inside a Zone or not ...
|
||||
*
|
||||
*
|
||||
* @param index: int, reference to holds detected index ...
|
||||
* @param bar: reference to Specified Bar ...
|
||||
* @param source: reference collection to provide source ...
|
||||
*
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool HasInside(
|
||||
@@ -4307,11 +4367,11 @@ bool HasInside(
|
||||
|
||||
/**
|
||||
* Extract all Items which Specified Bar is inside them ...
|
||||
*
|
||||
*
|
||||
* @param bar: reference to Specified Bar ...
|
||||
* @param dest: reference to result ...
|
||||
* @param source: reference collection to provide source ...
|
||||
*
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
int ExtractInsides(
|
||||
|
||||
Reference in New Issue
Block a user