pieterderycke / Jace

Jace.NET is a calculation engine for the .NET platform.
MIT License
436 stars 94 forks source link

string support #32

Open ghost opened 6 years ago

ghost commented 6 years ago

support for string variables, comparison and evaluation. Example:

if(var_1=='A', 'Match', 'No Match')

pieterderycke commented 6 years ago

I could look for support in Jace 1.0. Currently I first plan to release a 0.9.1 increasing the number of out of the box provided functions drastically.

Mortana89 commented 4 years ago

Would it be difficult to enhance the function registry to accept strings as positional parameters? That would make it possible using something like expression = myFunction('param1string', 'param2string', 3.0). Currently the function registry only accepts passing doubles :(

timjen3 commented 2 years ago

It would be handy to use string parameters for derived attributes. For example:

skill = 10;
hp = 6;
difficulty = "hp * 2";

_engine.Calculate("difficulty <= skill");  // result is 0 since 12 > 10