The current property on world (for stacks) and stack (for cards) is an index, i.e. it's the list order of the card that is current. This works fine with adding new stacks/cards, since indexes remain valid when a list grows, but creates issues when removing them, i.e. the current property does not behave the same way with add (function) and delete (its inverse) which is bad design bound to cause issues.
For example, if we want to allow delete current card we immediately hit race conditions, such as the one described in #217. Moreover, we are likely to have all sorts of issues if we allow for stack and card reordering on the fly, combined with adding and deleting.
Main Issue
The
current
property on world (for stacks) and stack (for cards) is an index, i.e. it's the list order of the card that is current. This works fine with adding new stacks/cards, since indexes remain valid when a list grows, but creates issues when removing them, i.e. the current property does not behave the same way withadd
(function) anddelete
(its inverse) which is bad design bound to cause issues.For example, if we want to allow
delete current card
we immediately hit race conditions, such as the one described in #217. Moreover, we are likely to have all sorts of issues if we allow for stack and card reordering on the fly, combined with adding and deleting.Related to re-ordering as described in #182