Open jkomoros opened 5 years ago
https://github.com/Knetic/govaluate will likely be useful
You can also imagine there being variables that may change at any time (maybe it's the "Computed Properties"? That introduces some weird properties to the system, but NUM_PLAYERS
already invalidates certain caching strategies so 🤷♂
Discovered while working on #736
Ideally we'd need some way to do things like interpret
NUM_PLAYERS - (NUM_PLAYERS / 2)
The constants dict should automatically be extended with things like NUM_PLAYERS and a few others (what else would they be?). All of them would have to be fixed for the life of the game. Maybe things like
<DECK_NAME>_LENGTH
and<ENUM_NAME>_LENGTH
And then there'd need to be a way to, given a string statement, interpret it as a float with basic math operators, so you could do things like
NUM_PLAYERS - (NUM_PLAYERS / 2)