File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-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"
@@ -105,6 +108,17 @@ std::shared_ptr<Entity> InputValue::valuePtr() const
105108/* ! Sets the value pointer. */
106109void InputValue::setValuePtr (const std::shared_ptr<Entity> &newValuePtr)
107110{
111+ if (std::dynamic_pointer_cast<Broadcast>(newValuePtr))
112+ setType (Type::Broadcast);
113+ else if (std::dynamic_pointer_cast<Variable>(newValuePtr))
114+ setType (Type::Variable);
115+ else if (std::dynamic_pointer_cast<List>(newValuePtr))
116+ setType (Type::List);
117+ else {
118+ impl->valuePtr = nullptr ;
119+ return ;
120+ }
121+
108122 impl->valuePtr = newValuePtr;
109123}
110124
You can’t perform that action at this time.
0 commit comments