summaryrefslogtreecommitdiffstats
path: root/inc/mine-sweeper/player/clui.h
diff options
context:
space:
mode:
Diffstat (limited to 'inc/mine-sweeper/player/clui.h')
-rwxr-xr-xinc/mine-sweeper/player/clui.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/inc/mine-sweeper/player/clui.h b/inc/mine-sweeper/player/clui.h
new file mode 100755
index 0000000..df02a85
--- /dev/null
+++ b/inc/mine-sweeper/player/clui.h
@@ -0,0 +1,73 @@
+/******************************************************************************
+ * Copyright (C) 2015 Alejandro Colomar Andrés *
+ ******************************************************************************/
+
+
+/******************************************************************************
+ ******* include guard ********************************************************
+ ******************************************************************************/
+#ifndef MSW_PLAYER_CLUI_H
+#define MSW_PLAYER_CLUI_H
+
+
+/******************************************************************************
+ ******* headers **************************************************************
+ ******************************************************************************/
+#include <stdio.h>
+
+#include "mine-sweeper/game/iface.h"
+#include "mine-sweeper/player/iface.h"
+
+
+/******************************************************************************
+ ******* enums ****************************************************************
+ ******************************************************************************/
+enum Player_CLUI_Char {
+ PLAYER_CLUI_CHAR_ERROR = 'X',
+ PLAYER_CLUI_CHAR_KBOOM = '#',
+ PLAYER_CLUI_CHAR_HIDDEN_FIELD = '+',
+ PLAYER_CLUI_CHAR_HIDDEN_MINE = '*',
+ PLAYER_CLUI_CHAR_HIDDEN_SAFE = '-',
+ PLAYER_CLUI_CHAR_SAFE_MINE = 'v',
+ PLAYER_CLUI_CHAR_0 = ' ',
+ PLAYER_CLUI_CHAR_1 = '1',
+ PLAYER_CLUI_CHAR_2 = '2',
+ PLAYER_CLUI_CHAR_3 = '3',
+ PLAYER_CLUI_CHAR_4 = '4',
+ PLAYER_CLUI_CHAR_5 = '5',
+ PLAYER_CLUI_CHAR_6 = '6',
+ PLAYER_CLUI_CHAR_7 = '7',
+ PLAYER_CLUI_CHAR_8 = '8',
+ PLAYER_CLUI_CHAR_FLAG = '!',
+ PLAYER_CLUI_CHAR_FLAG_FALSE = 'F',
+ PLAYER_CLUI_CHAR_POSSIBLE = '?',
+ PLAYER_CLUI_CHAR_POSSIBLE_FALSE = 'f'
+};
+
+
+/******************************************************************************
+ ******* functions ************************************************************
+ ******************************************************************************/
+void player_clui_start (const struct Player_Iface_Position *position,
+ const char *title, const char *subtitle,
+ int *action);
+
+void player_clui (const struct Game_Iface_Out *board,
+ const struct Player_Iface_Position *position,
+ const char *title, const char *subtitle,
+ int *action);
+
+void player_clui_save_name (const char *fpath,
+ char fname[static restrict FILENAME_MAX]);
+void player_clui_score_name (char player_name[static restrict BUFSIZ]);
+
+
+/******************************************************************************
+ ******* include guard ********************************************************
+ ******************************************************************************/
+# endif /* player_clui.h */
+
+
+/******************************************************************************
+ ******* end of file **********************************************************
+ ******************************************************************************/