Add MOVE_NO_EFFECT and MOVE_UNUSED return values from interpret_move()

These allow for distinguishing the case where a puzzle doesn't have a
use for a key from the case where it just happens to have no effect in
the current state of the puzzle.  These were both represented by NULL,
but that now represents the case where a puzzle hasn't been updated to
make the distinction yet.
This commit is contained in:
Ben Harris
2023-06-04 19:02:21 +01:00
parent a9af3fda1d
commit a943f3177f
4 changed files with 29 additions and 11 deletions

View File

@ -800,12 +800,20 @@ extern const game thegame;
#endif
/*
* Special string value to return from interpret_move in the case
* where the game UI has been updated but no actual move is being
* appended to the undo chain. Must be declared as a non-const char,
* but should never actually be modified by anyone.
* Special string values to return from interpret_move.
*
* MOVE_UI_UPDATE is for the case where the game UI has been updated
* but no actual move is being appended to the undo chain.
*
* MOVE_NO_EFFECT is for when the key was understood by the puzzle,
* but it happens that there isn't effect, not even a UI change.
*
* MOVE_UNUSED is for keys that the puzzle has no use for at all.
*
* Each must be declared as a non-const char, but should never
* actually be modified by anyone.
*/
extern char MOVE_UI_UPDATE[];
extern char MOVE_UI_UPDATE[], MOVE_NO_EFFECT[], MOVE_UNUSED[];
/* A little bit of help to lazy developers */
#define DEFAULT_STATUSBAR_TEXT "Use status_bar() to fill this in."