@@ -74,13 +74,17 @@ protected override void Definition()
7474 Value = VariableDefinition . Type switch {
7575 VariableType . Integer => ValueInput < int > ( nameof ( Value ) , 0 ) ,
7676 VariableType . Float => ValueInput < float > ( nameof ( Value ) , 0f ) ,
77- _ => throw new ArgumentOutOfRangeException ( $ "Type must be integer or float.")
77+ VariableType . Boolean => ValueInput < bool > ( nameof ( Value ) , false ) ,
78+ VariableType . String => ValueInput < string > ( nameof ( Value ) , string . Empty ) ,
79+ _ => throw new ArgumentOutOfRangeException ( )
7880 } ;
7981
8082 OutputValue = VariableDefinition . Type switch {
8183 VariableType . Integer => ValueOutput < int > ( nameof ( Value ) ) ,
8284 VariableType . Float => ValueOutput < float > ( nameof ( Value ) ) ,
83- _ => throw new ArgumentOutOfRangeException ( $ "Type must be integer or float.")
85+ VariableType . Boolean => ValueOutput < bool > ( nameof ( Value ) ) ,
86+ VariableType . String => ValueOutput < string > ( nameof ( Value ) ) ,
87+ _ => throw new ArgumentOutOfRangeException ( )
8488 } ;
8589 Requirement ( Value , InputTrigger ) ;
8690 }
@@ -104,8 +108,23 @@ private ControlOutput Process(Flow flow)
104108 flow . SetValue ( OutputValue , current + flow . GetValue < float > ( Value ) ) ;
105109 break ;
106110 }
111+ case VariableType . Boolean : {
112+ if ( flow . GetValue < bool > ( Value ) ) {
113+ var current = ( bool ) State . Get < Bool > ( VariableDefinition . Id ) ;
114+ State . Set ( VariableDefinition . Id , new Bool ( ! current ) ) ;
115+ flow . SetValue ( OutputValue , ! current ) ;
116+ }
117+ break ;
118+ }
119+ case VariableType . String : {
120+ var current = State . Get < string > ( VariableDefinition . Id ) ;
121+ var next = current + flow . GetValue < string > ( Value ) ;
122+ State . Set ( VariableDefinition . Id , next ) ;
123+ flow . SetValue ( OutputValue , next ) ;
124+ break ;
125+ }
107126 default :
108- throw new ArgumentOutOfRangeException ( $ "Type must be integer or float." ) ;
127+ throw new ArgumentOutOfRangeException ( ) ;
109128 }
110129
111130 return OutputTrigger ;
0 commit comments