Skip to content
Snippets Groups Projects
Commit 32e4da8c authored by Arkerthan's avatar Arkerthan
Browse files

testGenetics can now handle layered objects

parent 5dfe549b
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,17 @@ All slave array slaves MUST be present in genePool or else there is a malfunctio
<<set _error = $genePool.every(function(g) { return $slaves[_i].ID !== g.ID; })>>
<<if _error>><<set _errorCause = "Doesn't exist in the gene pool">><</if>>
<<if !_error>>
<<set _missingProperties = _neededProperties.filter(function(p) { return !(p in _s);})>>
<<set _missingProperties = _neededProperties.filter(function(p) {
p = p.split(".");
let c = _s;
for (const r of p) {
if (!(r in c)) {
return true;
}
c = c[r];
}
return false;
})>>
<<if _missingProperties.length > 0>>
<<set _error = true, _errorCause = "Missing properties: " + _missingProperties.join(", ")>>
<</if>>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment