libscratchcpp
A library for C++ based Scratch project players
Loading...
Searching...
No Matches
libscratchcpp::InputValue Class Reference

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)
 
CompilerValuecompile (Compiler *compiler)
 
Type type () const
 
void setType (Type newType)
 
const Valuevalue () const
 
void setValue (const Value &newValue)
 
BlockvalueBlock () const
 
void setValueBlock (Block *newValueBlock)
 
const std::string & valueBlockId () const
 
void setValueBlockId (const std::string &newValueBlockId)
 
std::shared_ptr< EntityvaluePtr () const
 
void setValuePtr (const std::shared_ptr< Entity > &newValuePtr)
 
const std::string & valueId () const
 
void setValueId (const std::string &newValueId)
 

Detailed Description

The InputValue class provides methods for the value of an Input.

Member Enumeration Documentation

◆ Type

Enumerator
Number 
PositiveNumber 
PositiveInteger 
Integer 
Angle 
Color 
String 
Broadcast 
Variable 
List 

Constructor & Destructor Documentation

◆ InputValue()

InputValue::InputValue ( Type type = Type::Number)

Constructs InputValue with the given type.

Member Function Documentation

◆ compile()

CompilerValue * InputValue::compile ( Compiler * compiler)

Compiles the input value.

◆ setType()

void InputValue::setType ( Type newType)

Sets the type of the value.

◆ setValue()

void InputValue::setValue ( const Value & newValue)

Sets the value.

◆ setValueBlock()

void InputValue::setValueBlock ( Block * newValueBlock)

Sets the block.

See also
Input::setValueBlock()

◆ setValueBlockId()

void InputValue::setValueBlockId ( const std::string & newValueBlockId)

Sets the ID of the block.

See also
setValueBlock()

◆ setValueId()

void InputValue::setValueId ( const std::string & newValueId)

◆ setValuePtr()

void InputValue::setValuePtr ( const std::shared_ptr< Entity > & newValuePtr)

Sets the value pointer.

◆ type()

InputValue::Type InputValue::type ( ) const

Returns the type of the value.

◆ value()

const Value & InputValue::value ( ) const

Returns the value.

◆ valueBlock()

Block * InputValue::valueBlock ( ) const

Returns the block.

See also
Input::valueBlock()

◆ valueBlockId()

const std::string & InputValue::valueBlockId ( ) const

Returns the ID of the block.

See also
valueBlock()

◆ valueId()

const std::string & InputValue::valueId ( ) const

Returns the ID of the value.

◆ valuePtr()

std::shared_ptr< Entity > InputValue::valuePtr ( ) const

Returns a pointer to the value (e. g. a variable).


The documentation for this class was generated from the following files: