|
libscratchcpp
A library for C++ based Scratch project players
|
The Thread class represents a running Scratch script. More...
#include <scratchcpp/thread.h>
Public Member Functions | |
| Thread (Target *target, IEngine *engine, Script *script) | |
| Thread (const Thread &)=delete | |
| Target * | target () const |
| IEngine * | engine () const |
| Script * | script () const |
| void | run () |
| ValueData | runReporter () |
| bool | runPredicate () |
| void | kill () |
| void | reset () |
| bool | isFinished () const |
| std::shared_ptr< Promise > | promise () const |
| void | setPromise (std::shared_ptr< Promise > promise) |
The Thread class represents a running Scratch script.
|
delete |
| IEngine * Thread::engine | ( | ) | const |
Returns the engine of the project.
| bool Thread::isFinished | ( | ) | const |
Returns true if the script is stopped or finished.
| void Thread::kill | ( | ) |
Stops the script.
| std::shared_ptr< Promise > Thread::promise | ( | ) | const |
Returns the script promise.
| void Thread::reset | ( | ) |
Resets the script to run from the start.
| void Thread::run | ( | ) |
Runs the script until it finishes or yields.
| bool Thread::runPredicate | ( | ) |
Runs the hat predicate and returns its return value.
| ValueData Thread::runReporter | ( | ) |
Runs the reporter and returns its return value.
| void Thread::setPromise | ( | std::shared_ptr< Promise > | promise | ) |
Sets the script promise (yields until the promise is resolved).