forked from rojo-rbx/rojo
Confirmation behaviors (#774)
This commit is contained in:
@@ -116,7 +116,7 @@ function PatchSet.containsId(patchSet, instanceMap, id)
|
||||
end
|
||||
|
||||
--[[
|
||||
Tells whether the given PatchSet contains changes to the given instance.
|
||||
Tells whether the given PatchSet contains changes to the given instance.
|
||||
If the given InstanceMap does not contain the instance, this function always returns false.
|
||||
]]
|
||||
function PatchSet.containsInstance(patchSet, instanceMap, instance)
|
||||
@@ -235,6 +235,28 @@ function PatchSet.countChanges(patch)
|
||||
return count
|
||||
end
|
||||
|
||||
--[[
|
||||
Count the number of instances affected by the given PatchSet.
|
||||
]]
|
||||
function PatchSet.countInstances(patch)
|
||||
local count = 0
|
||||
|
||||
-- Added instances
|
||||
for _ in patch.added do
|
||||
count += 1
|
||||
end
|
||||
-- Removed instances
|
||||
for _ in patch.removed do
|
||||
count += 1
|
||||
end
|
||||
-- Updated instances
|
||||
for _ in patch.updated do
|
||||
count += 1
|
||||
end
|
||||
|
||||
return count
|
||||
end
|
||||
|
||||
--[[
|
||||
Merge multiple PatchSet objects into the given PatchSet.
|
||||
]]
|
||||
|
||||
Reference in New Issue
Block a user