created function that splits and preserves links

This commit is contained in:
itsmattkc
2019-10-17 10:51:50 +11:00
parent 2860fe33a0
commit 276478c6d0
6 changed files with 112 additions and 8 deletions
+9
View File
@@ -235,6 +235,10 @@ void Block::Link(Block *a, Block *b)
return;
}
if (a == nullptr || b == nullptr) {
return;
}
// Assume both clips are already linked since Link() and Unlink() should be the only entry points to this array
if (a->linked_clips_.contains(b)) {
return;
@@ -259,6 +263,11 @@ void Block::Unlink(Block *a, Block *b)
b->linked_clips_.removeOne(a);
}
bool Block::AreLinked(Block *a, Block *b)
{
return a->linked_clips_.contains(b);
}
const QVector<Block*> &Block::linked_clips()
{
return linked_clips_;