public static void Undo() { if (Main.cwin == 0) { if (FastMem.RestoreUndo() > 0) { OS.ResetScreen(); //OS.DisplayString("One Move Undone...\n>"); if (Main.h_version >= ZMachine.V5) { /* for V5+ games we must */ Process.Store(2); /* store 2 (for success) */ return; } if (Main.h_version <= ZMachine.V3) { /* for V3- games we must */ Screen.ZShowStatus(); /* draw the status line */ return; } OS.DisplayString("\nOne move undone...\n>"); } } }
}/* hot_key_seed */ /* * hot_key_undo * * ...allows user to undo the previous turn. * */ public static bool HotkeyUndo() { Text.PrintString("Undo one turn\n"); if (FastMem.RestoreUndo() > 0) { if (Main.h_version >= ZMachine.V5) { /* for V5+ games we must */ Process.Store(2); /* store 2 (for success) */ return(true); /* and abort the input */ } if (Main.h_version <= ZMachine.V3) { /* for V3- games we must */ Screen.ZShowStatus(); /* draw the status line */ return(false); /* and continue input */ } } else { Text.PrintString("No more undo information available.\n"); } return(false); }/* hot_key_undo */