Closed Itangalo closed 2 years ago
Yes. An ObjectContition class, with .addAndCondition, .addOrCondition, .addNotCondition .evaluateOn(), .selectFromArray() and .spliceFromArray().
Added conditions are either property:value pairs, in some thought-through format, or another ObjectCondition object.
Also have comparisons like ">" and "<="?
Docs in place.
Tests in place. Moving rest of potential functionality to a new issue.
There are cases where conditions may get quite complex when modeling board games, and conditions are used in quite a few functions. It could make sense to introduce a Condition class, which itself evaluates the condition(s).