Skip to content

Commit 688609f

Browse files
committed
Block: Add getters for engine and target
1 parent c7dcab7 commit 688609f

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

include/scratchcpp/block.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ class LIBSCRATCHCPP_EXPORT Block : public Entity
5555
bool topLevel() const;
5656

5757
void setEngine(IEngine *newEngine);
58+
IEngine *engine() const;
5859

5960
void setTarget(Target *newTarget);
61+
Target *target() const;
6062

6163
BlockComp compileFunction() const;
6264
void setCompileFunction(BlockComp newCompileFunction);

src/scratch/block.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,20 @@ void Block::setEngine(IEngine *newEngine)
251251
impl->engine = newEngine;
252252
}
253253

254+
/*! Returns the Engine. */
255+
IEngine *Block::engine() const
256+
{
257+
return impl->engine;
258+
}
259+
254260
/*! Sets the Target. */
255261
void Block::setTarget(Target *newTarget)
256262
{
257263
impl->target = newTarget;
258264
}
265+
266+
/*! Returns the Target. */
267+
Target *Block::target() const
268+
{
269+
return impl->target;
270+
}

0 commit comments

Comments
 (0)