From: Erik V. <eri...@xs...> - 2012-07-06 09:01:24
|
Hi Stefan, Just a few comments. > Remark: I changed the term "Move" in Rails1.x to the term "Change" in > Rails2.0 to avoid the confusion with an in-game tile move or token move. > ChangeStack and ChangeSet are MoveStack and MoveSet in Rails1.x. I agree that Change is better than Move. > Remark: This is different to Rails1.x, for which some State changes could get > lost, as there was no open ChangeSet available at the time of processing. The explicit opening and closing of MoveSets was intentional, to make sure that no changes would exist outside of the "change window" after receiving and validating a player action. Just a matter of trying to ensure some programming discipline: any change outside that window was considered illegal. Unfortunately, I never got to catch such illegal changes, so the only way to find these errors was inspecting the logs. (This omission has been the cause of several undo bugs, so this incomplete cure may have been worse than the disease.) In fact you are dropping this change window concept, allowing changes at any time. Two further comments on that: 1. You no longer can enforce that no changes are done before validation is complete. Any such premature changes will now end up in an open AutoChangeSet. I would prefer an approach where whatever changeset is open would be closed before the engine passes control back to the UI, and any premature changes when no changeset is open should be catched somehow, perhaps by throwing an exception. I'm not sure if that is practical, however; if not, I may have to settle with your approach, although somewhat reluctantly. 2. I'm not sure if 'action' and 'auto' changes can be separated so easily, in the sense that the latter always follow the former. Did you check that? I'm particularly thinking of special cases like the CGR formation, where player and auto actions seem rather intertwined to me. 3. Do you still link change sets so that these can only be undone as a whole? Apart from these comments, I generally like your changes. Erik. |