// Vector with common assets inside
std::vector<Asset*> commonAssets;
bool duplicate = false;
// Checking each element in level 1 against the elements in level 2
for(Asset l1 : LevelOneAssets){
for(Asset l2 : LevelTwoAssets){
// if elements address are equal, check if common assets already has that element inside
if(*l1 == *l2){
// check through all common assets against the new common element to see if any duplicates
for(Asset dup : commonAssets){
if(*l1 == *dup){
duplicate = true;
}
}
if(duplicate == false){
commonAssets.push_back(l1);
}
duplicate = false;
}
}
}
outUniqueCommonAssets = commonAssets;