SET_BASE - cmpleted GetSetComplement

This commit is contained in:
Applevangelist 2021-10-29 10:20:34 +02:00
parent c0a558e229
commit f70180eb66

View File

@ -308,17 +308,14 @@ do -- SET_BASE
-- @return Core.Set#SET_BASE The set of objects that are in set *B* but **not** in this set *A*.
function SET_BASE:GetSetComplement(SetB)
local complement=SET_BASE:New()
local complement = self:GetSetUnion(SetB)
local intersection = self:GetSetIntersection(SetB)
local union=self:GetSetUnion(SetA, SetB)
for _,Object in pairs(union.Set) do
if SetA:IsIncludeObject(Object) and SetB:IsIncludeObject(Object) then
intersection:Add(intersection)
end
for _,Object in pairs(intersection.Set) do
complement:Remove(Object.ObjectName,true)
end
return intersection
return complement
end