|
libscratchcpp
A library for C++ based Scratch project players
|
The Script class represents a compiled Scratch script. More...
#include <scratchcpp/script.h>
Public Member Functions | |
| Script (Target *target, Block *topBlock, IEngine *engine) | |
| Script (const Script &)=delete | |
| Target * | target () const |
| Block * | topBlock () const |
| ExecutableCode * | code () const |
| void | setCode (std::shared_ptr< ExecutableCode > code) |
| ExecutableCode * | hatPredicateCode () const |
| void | setHatPredicateCode (std::shared_ptr< ExecutableCode > code) |
| bool | runHatPredicate (Target *target) |
| std::shared_ptr< Thread > | start () |
| std::shared_ptr< Thread > | start (Target *target) |
The Script class represents a compiled Scratch script.
|
delete |
| ExecutableCode * Script::code | ( | ) | const |
Returns the executable code of the script.
| ExecutableCode * Script::hatPredicateCode | ( | ) | const |
Returns the executable code of the hat predicate.
| bool Script::runHatPredicate | ( | Target * | target | ) |
Runs the edge-activated hat predicate as the given target and returns the reported value.
| void Script::setCode | ( | std::shared_ptr< ExecutableCode > | code | ) |
Sets the executable code of the script.
| void Script::setHatPredicateCode | ( | std::shared_ptr< ExecutableCode > | code | ) |
Sets the executable code of the hat predicate.
| std::shared_ptr< Thread > Script::start | ( | ) |
Starts the script (creates a thread).
Starts the script (creates a thread) as the given target (might be a clone).
| Block * Script::topBlock | ( | ) | const |
Returns the first block (usually hat) of the script.