File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 33#include < scratchcpp/inputvalue.h>
44#include < scratchcpp/compiler.h>
55#include < scratchcpp/entity.h>
6+ #include < scratchcpp/broadcast.h>
7+ #include < scratchcpp/variable.h>
8+ #include < scratchcpp/list.h>
69#include < map>
710
811#include " inputvalue_p.h"
@@ -106,6 +109,13 @@ std::shared_ptr<Entity> InputValue::valuePtr() const
106109void InputValue::setValuePtr (const std::shared_ptr<Entity> &newValuePtr)
107110{
108111 impl->valuePtr = newValuePtr;
112+
113+ if (std::dynamic_pointer_cast<Broadcast>(newValuePtr))
114+ setType (Type::Broadcast);
115+ else if (std::dynamic_pointer_cast<Variable>(newValuePtr))
116+ setType (Type::Variable);
117+ else if (std::dynamic_pointer_cast<List>(newValuePtr))
118+ setType (Type::List);
109119}
110120
111121/* ! Returns the ID of the value. */
You can’t perform that action at this time.
0 commit comments