-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreplay.h
61 lines (46 loc) · 1.75 KB
/
replay.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/****************************************************************************
This file is part of XorCurses a port/remake of the game Xor
(originally by Astral Software) to the Linux console using
ncurses.
XorCurses written by James W. Morris - [email protected]
All code licensed under GNU GPL v3.
file: replay.h
purpose: data structure for storing each move player makes and
functions for playing these moves back as a 'replay'.
also creates the menu for the replay options, and load/save
functions.
****************************************************************************/
#ifndef _REPLAY_H
#define _REPLAY_H
#include "types.h"
#include "play_xor.h" /* for enum param in replay() */
struct xor_replay
{
su_t level;
su_t moves[MAX_MOVES + 1];
su_t canplay;
su_t hasexit;
};
extern struct xor_replay replay;
void replay_menu_create(void);
void replay_menu_destroy(void);
/* replay_menu now called before play_xor actually quits out of
its main loop - this should simplify the code for continuing
game play somewhat. RM_CANCEL_QUIT and RM_DO_QUIT returned
by replay_menu and checked by the quit case statement within
the play_xor main loop - rather than immediately quitting out
of the main loop only to call it again because quit was cancelled.
*/
int replay_menu(int flow);
int replay_xor(int flow);
void replay_save(void);
lvl_t replay_load(void);
#ifdef DEBUG
/* replay_dump_break_quit_moves steps through player.moves_remaining,
-10 to +10 and any replay.moves with the MV_PLAYER_QUIT or
MV_REPLAY_BREAK bits set - the relative move index to moves_remaining
is displayed.
*/
void replay_dump_break_quit_moves(void);
#endif
#endif