| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2022-01-30 00:37:05 +0100 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2022-01-30 00:37:05 +0100 |
| commit | b1d6d8af0e31123d46e102bc68fcfd02d3b51256 (patch) | |
| tree | 9caad859acaf7481d248d3d5e0de9d3c9114a0b2 /src/Tonkadur/Compute.elm | |
| parent | 0705fbf7c20c5002c26a2c9faa9663b047189e39 (diff) | |
...
Diffstat (limited to 'src/Tonkadur/Compute.elm')
| -rw-r--r-- | src/Tonkadur/Compute.elm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Tonkadur/Compute.elm b/src/Tonkadur/Compute.elm index 149f37d..a75ef7c 100644 --- a/src/Tonkadur/Compute.elm +++ b/src/Tonkadur/Compute.elm @@ -108,6 +108,7 @@ cast state from to param = ) "float" -> (Tonkadur.Types.FloatValue (toFloat int)) + "bool" -> (Tonkadur.Types.BoolValue (not (int == 0))) "int" -> (Tonkadur.Types.IntValue int) _ -> (unsupported_cast from to) @@ -130,6 +131,11 @@ cast state from to param = Nothing -> (unsupported_cast from to) (Just result) -> (Tonkadur.Types.IntValue result) + "bool" -> + (Tonkadur.Types.BoolValue + ((String.toLower (String.trim as_string)) == "true") + ) + "text" -> (Tonkadur.Types.TextValue text_v) _ -> (unsupported_cast from to) @@ -146,6 +152,11 @@ cast state from to param = Nothing -> (unsupported_cast from to) (Just result) -> (Tonkadur.Types.IntValue result) + "bool" -> + (Tonkadur.Types.BoolValue + ((String.toLower (String.trim string)) == "true") + ) + "text" -> (Tonkadur.Types.TextValue (Tonkadur.Types.StringText string)) |


