File tree Expand file tree Collapse file tree 4 files changed +1
-15
lines changed
Expand file tree Collapse file tree 4 files changed +1
-15
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,6 @@ class LIBSCRATCHCPP_EXPORT Block : public Entity
5353 void setShadow (bool newShadow);
5454
5555 bool topLevel () const ;
56- void setTopLevel (bool newTopLevel);
5756
5857 void setEngine (IEngine *newEngine);
5958
Original file line number Diff line number Diff line change @@ -177,10 +177,6 @@ bool Scratch3Reader::load()
177177 READER_STEP (step, " target -> block -> shadow" );
178178 block->setShadow (blockInfo[" shadow" ]);
179179
180- // topLevel
181- READER_STEP (step, " target -> block -> topLevel" );
182- block->setTopLevel (blockInfo[" topLevel" ]);
183-
184180 target->addBlock (block);
185181 }
186182
Original file line number Diff line number Diff line change @@ -222,15 +222,7 @@ void Block::setShadow(bool newShadow)
222222/* ! Returns true if this is a top level block. */
223223bool Block::topLevel () const
224224{
225- // TODO: Return true if parentId() == ""
226- // and remove the setter
227- return impl->topLevel ;
228- }
229-
230- /* ! Toggles whether this block is a top level block. */
231- void Block::setTopLevel (bool newTopLevel)
232- {
233- impl->topLevel = newTopLevel;
225+ return (impl->parentId == " " && !impl->parent );
234226}
235227
236228/* ! Sets the Engine. */
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ struct BlockPrivate
2929 std::vector<std::shared_ptr<Field>> fields;
3030 std::unordered_map<int , Field *> fieldMap;
3131 bool shadow = false ;
32- bool topLevel = false ;
3332 IEngine *engine = nullptr ;
3433 Target *target = nullptr ;
3534 BlockPrototype mutationPrototype;
You can’t perform that action at this time.
0 commit comments