libscratchcpp
A library for C++ based Scratch project players
Toggle main menu visibility
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
10
namespace
libscratchcpp
11
{
12
13
class
CompilerValue
;
14
class
Block
;
15
class
Entity
;
16
class
InputValuePrivate;
17
19
class
LIBSCRATCHCPP_EXPORT
InputValue
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,
31
Broadcast
= 11,
32
Variable
= 12,
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
libscratchcpp::Block
The Block class represents a Scratch block.
Definition
block.h:24
libscratchcpp::Broadcast
The Broadcast class represents a Scratch broadcast.
Definition
broadcast.h:14
libscratchcpp::CompilerValue
The CompilerValue class represents a local value in compiled code.
Definition
compilervalue.h:14
libscratchcpp::Compiler
The Compiler class provides API for compiling Scratch scripts.
Definition
compiler.h:33
libscratchcpp::Entity
The Entity class is the base class of everything that is identified by an ID (Target,...
Definition
entity.h:17
libscratchcpp::InputValue
The InputValue class provides methods for the value of an Input.
Definition
inputvalue.h:20
libscratchcpp::InputValue::Type
Type
Definition
inputvalue.h:23
libscratchcpp::InputValue::InputValue
InputValue(Type type=Type::Number)
Definition
inputvalue.cpp:21
libscratchcpp::List
The List class represents a Scratch list.
Definition
list.h:27
libscratchcpp::Value
The Value class represents a Scratch value.
Definition
value.h:22
libscratchcpp::Variable
The Variable class represents a Scratch variable.
Definition
variable.h:18
LIBSCRATCHCPP_EXPORT
#define LIBSCRATCHCPP_EXPORT
Definition
global.h:17
libscratchcpp
The main namespace of the library.
Definition
asset.h:10
value.h
String
String
Definition
valuedata.h:18
Number
Number
Definition
valuedata.h:16
include
scratchcpp
inputvalue.h
Generated by
1.17.0