|
libscratchcpp
A library for C++ based Scratch project players
|
The InputValue class provides methods for the value of an Input. More...
#include <scratchcpp/inputvalue.h>
Public Types | |
| enum class | Type { Number = 4 , PositiveNumber = 5 , PositiveInteger = 6 , Integer = 7 , Angle = 8 , Color = 9 , String = 10 , Broadcast = 11 , Variable = 12 , List = 13 } |
Public Member Functions | |
| InputValue (Type type=Type::Number) | |
| CompilerValue * | compile (Compiler *compiler) |
| Type | type () const |
| void | setType (Type newType) |
| const Value & | value () const |
| void | setValue (const Value &newValue) |
| Block * | valueBlock () const |
| void | setValueBlock (Block *newValueBlock) |
| const std::string & | valueBlockId () const |
| void | setValueBlockId (const std::string &newValueBlockId) |
| std::shared_ptr< Entity > | valuePtr () const |
| void | setValuePtr (const std::shared_ptr< Entity > &newValuePtr) |
| const std::string & | valueId () const |
| void | setValueId (const std::string &newValueId) |
The InputValue class provides methods for the value of an Input.
|
strong |
| InputValue::InputValue | ( | Type | type = Type::Number | ) |
Constructs InputValue with the given type.
| CompilerValue * InputValue::compile | ( | Compiler * | compiler | ) |
Compiles the input value.
| void InputValue::setType | ( | Type | newType | ) |
Sets the type of the value.
| void InputValue::setValue | ( | const Value & | newValue | ) |
Sets the value.
| void InputValue::setValueBlock | ( | Block * | newValueBlock | ) |
Sets the block.
| void InputValue::setValueBlockId | ( | const std::string & | newValueBlockId | ) |
Sets the ID of the block.
| void InputValue::setValueId | ( | const std::string & | newValueId | ) |
| void InputValue::setValuePtr | ( | const std::shared_ptr< Entity > & | newValuePtr | ) |
Sets the value pointer.
| InputValue::Type InputValue::type | ( | ) | const |
Returns the type of the value.
| const Value & InputValue::value | ( | ) | const |
Returns the value.
| Block * InputValue::valueBlock | ( | ) | const |
Returns the block.
| const std::string & InputValue::valueBlockId | ( | ) | const |
Returns the ID of the block.
| const std::string & InputValue::valueId | ( | ) | const |
Returns the ID of the value.
| std::shared_ptr< Entity > InputValue::valuePtr | ( | ) | const |
Returns a pointer to the value (e. g. a variable).