summaryrefslogtreecommitdiffstats
path: root/modules/player/inc/player_iface.h
blob: a60a0ac735e634848c52c9f4a4f5d97e2f73f3b4 (plain) (blame)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/******************************************************************************
 *	Copyright (C) 2015	Alejandro Colomar Andrés		      *
 ******************************************************************************/


/******************************************************************************
 ******* include guard ********************************************************
 ******************************************************************************/
# ifndef		MSW_PLAYER_IFACE_H
	# define	MSW_PLAYER_IFACE_H


/******************************************************************************
 ******* headers **************************************************************
 ******************************************************************************/
	/* struct Game_Iface_... */
	#include "game_iface.h"


/******************************************************************************
 ******* enums ****************************************************************
 ******************************************************************************/
	enum	Player_Iface_Mode {
		PLAYER_IFACE_FOO = 0,
		PLAYER_IFACE_CLUI,
		PLAYER_IFACE_TUI,
		PLAYER_IFACE_GUI
	};

	enum	Player_Iface_Action {
		PLAYER_IFACE_ACT_FOO,
		PLAYER_IFACE_ACT_STEP,
		PLAYER_IFACE_ACT_FLAG,
		PLAYER_IFACE_ACT_FLAG_POSSIBLE,
		PLAYER_IFACE_ACT_RM_FLAG,

		PLAYER_IFACE_ACT_PAUSE,
		PLAYER_IFACE_ACT_SAVE,
		PLAYER_IFACE_ACT_XYZZY_ON,
		PLAYER_IFACE_ACT_XYZZY_OFF,
		PLAYER_IFACE_ACT_XYZZY_LIN,
		PLAYER_IFACE_ACT_XYZZY_P,
		PLAYER_IFACE_ACT_XYZZY_NP,
		PLAYER_IFACE_ACT_QUIT,

		PLAYER_IFACE_ACT_MOVE_UP,
		PLAYER_IFACE_ACT_MOVE_DOWN,
		PLAYER_IFACE_ACT_MOVE_RIGHT,
		PLAYER_IFACE_ACT_MOVE_LEFT,
		PLAYER_IFACE_ACT_HIGHLIGHT
	};


/******************************************************************************
 ******* structs **************************************************************
 ******************************************************************************/
	struct	Player_Iface_Position {
		int	rows;
		int	cols;
		int	row;
		int	col;
		int	highlight;
	};


/******************************************************************************
 ******* variables ************************************************************
 ******************************************************************************/
extern	int	player_iface_mode;


/******************************************************************************
 ******* functions ************************************************************
 ******************************************************************************/
void	player_iface_init	(int rows, int cols);
int	player_iface_start	(int *pos_row, int *pos_col);
void	player_iface		(const	struct Game_Iface_Out	*game_iface_out,
				const	struct Game_Iface_Score	*game_iface_score,
					struct Game_Iface_In	*game_iface_in);
void	player_iface_save_name	(const char *filepath, char *filename, int destsize);
void	player_iface_score_name	(char *player_name, int destsize);
void	player_iface_cleanup	(void);


/******************************************************************************
 ******* include guard ********************************************************
 ******************************************************************************/
# endif			/* player_iface.h */


/******************************************************************************
 ******* end of file **********************************************************
 ******************************************************************************/