libscratchcpp
A library for C++ based Scratch project players
Loading...
Searching...
No Matches
inputvalue.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2
3#pragma once
4
5#include <memory>
6
7#include "spimpl.h"
8#include "value.h"
9
10namespace libscratchcpp
11{
12
13class CompilerValue;
14class Block;
15class Entity;
16class InputValuePrivate;
17
20{
21 public:
22 enum class Type
23 {
24 Number = 4,
25 PositiveNumber = 5,
26 PositiveInteger = 6,
27 Integer = 7,
28 Angle = 8,
29 Color = 9,
30 String = 10,
33 List = 13
34 };
35
36 InputValue(Type type = Type::Number);
37
38 CompilerValue *compile(Compiler *compiler);
39
40 Type type() const;
41 void setType(Type newType);
42
43 const Value &value() const;
44 void setValue(const Value &newValue);
45
46 Block *valueBlock() const;
47 void setValueBlock(Block *newValueBlock);
48
49 const std::string &valueBlockId() const;
50 void setValueBlockId(const std::string &newValueBlockId);
51
52 std::shared_ptr<Entity> valuePtr() const;
53 void setValuePtr(const std::shared_ptr<Entity> &newValuePtr);
54
55 const std::string &valueId() const;
56 void setValueId(const std::string &newValueId);
57
58 private:
59 spimpl::impl_ptr<InputValuePrivate> impl;
60};
61
62} // namespace libscratchcpp
The Block class represents a Scratch block.
Definition block.h:24
The Broadcast class represents a Scratch broadcast.
Definition broadcast.h:14
The CompilerValue class represents a local value in compiled code.
Definition compilervalue.h:14
The Compiler class provides API for compiling Scratch scripts.
Definition compiler.h:33
The Entity class is the base class of everything that is identified by an ID (Target,...
Definition entity.h:17
The InputValue class provides methods for the value of an Input.
Definition inputvalue.h:20
Type
Definition inputvalue.h:23
InputValue(Type type=Type::Number)
Definition inputvalue.cpp:21
The List class represents a Scratch list.
Definition list.h:27
The Value class represents a Scratch value.
Definition value.h:22
The Variable class represents a Scratch variable.
Definition variable.h:18
#define LIBSCRATCHCPP_EXPORT
Definition global.h:17
The main namespace of the library.
Definition asset.h:10
String
Definition valuedata.h:18
Number
Definition valuedata.h:16