|
libscratchcpp
A library for C++ based Scratch project players
|
The Input class represents a Scratch block input. More...
#include <scratchcpp/input.h>
Public Types | |
| enum class | Type { Shadow = 1 , NoShadow = 2 , ObscuredShadow = 3 } |
Public Member Functions | |
| Input (const std::string &name, Type type) | |
| Input (const Input &)=delete | |
| const std::string & | name () const |
| Type | type () const |
| InputValue * | primaryValue () |
| InputValue * | secondaryValue () |
| void | setPrimaryValue (const Value &value) |
| void | setSecondaryValue (const Value &value) |
| Block * | valueBlock () const |
| const std::string & | valueBlockId () const |
| void | setValueBlock (Block *block) |
| void | setValueBlockId (const std::string &id) |
| bool | pointsToDropdownMenu () const |
| std::string | selectedMenuItem () const |
The Input class represents a Scratch block input.
|
strong |
|
delete |
| const std::string & Input::name | ( | ) | const |
Returns the name of the input.
| bool Input::pointsToDropdownMenu | ( | ) | const |
Returns true if the input points to a dropdown menu.
(if valueBlock() points to a shadow block with a single field which does not point to an entity)
| InputValue * Input::primaryValue | ( | ) |
Returns the primary value.
| InputValue * Input::secondaryValue | ( | ) |
Returns the secondary value (usually the value of an obscured shadow).
| std::string Input::selectedMenuItem | ( | ) | const |
Returns the selected item in the dropdown menu.
Works only pointsToDropdownMenu() is true.
| void Input::setPrimaryValue | ( | const Value & | value | ) |
Sets the primary value.
| void Input::setSecondaryValue | ( | const Value & | value | ) |
Sets the secondary value.
| void Input::setValueBlock | ( | Block * | block | ) |
Sets the block which obscures the shadow or, if there's a shadow, sets the block the input points to.
| void Input::setValueBlockId | ( | const std::string & | id | ) |
Sets the ID of the value block.
| Input::Type Input::type | ( | ) | const |
Returns the type of the input.
| Block * Input::valueBlock | ( | ) | const |
Returns the block which obscures the shadow.
| const std::string & Input::valueBlockId | ( | ) | const |
Returns the ID of the block which obscures the shadow or, if there's a shadow, returns the block the input points to.