-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathscript.h
More file actions
46 lines (33 loc) · 1015 Bytes
/
script.h
File metadata and controls
46 lines (33 loc) · 1015 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include <vector>
#include <memory>
#include "global.h"
#include "spimpl.h"
namespace libscratchcpp
{
class Target;
class Block;
class IEngine;
class ExecutableCode;
class Thread;
class ScriptPrivate;
/*! \brief The Script class represents a compiled Scratch script. */
class LIBSCRATCHCPP_EXPORT Script
{
public:
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);
private:
spimpl::unique_impl_ptr<ScriptPrivate> impl;
};
} // namespace libscratchcpp