diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/chc.h | 41 | ||||
-rw-r--r-- | include/proto.h | 21 |
2 files changed, 45 insertions, 17 deletions
diff --git a/include/chc.h b/include/chc.h new file mode 100644 index 00000000..9305ab0d --- /dev/null +++ b/include/chc.h @@ -0,0 +1,41 @@ +/* �H�� + * ���H��ԮɡA���賣�|���@�� chc_act_list �� linked-list�A�����ۨC�U�@�B + * �ѡA�����N�o�ӰT���ᵹ���ǤH�]socket�^�C + * �@�}�l���M�N�O���@�ӡA�C���@���[�Ѫ̥[�J�]�[�ѥi�H�q����ζ¤誺�[�I + * �i��^�A�䤤�@�誺�U�Ѫ̪� act_list �N�|�h�@���O���A����N�|�N�U���Φ� + * ����U���C�@�B�Ѷǵ� act_list ���Ҧ��ݭn���H�A�F���[�Ѫ��ĪG�C + */ + +#define SIDE_ROW 7 +#define TURN_ROW 8 +#define STEP_ROW 9 +#define TIME_ROW 10 +#define WARN_ROW 12 +#define MYWIN_ROW 17 +#define HISWIN_ROW 18 + +#define CHC_VERSUS 1 /* ���H */ +#define CHC_WATCH 2 /* �[�� */ +#define CHC_PERSONAL 4 /* ���� */ +#define CHC_WATCH_PERSONAL 8 /* �[�H���� */ + +#define BLACK_COLOR "\033[1;36m" +#define RED_COLOR "\033[1;31m" +#define BLACK_REVERSE "\033[1;37;46m" +#define RED_REVERSE "\033[1;37;41m" +#define TURN_COLOR "\033[1;33m" + +typedef struct chcusr_t{ + char userid[IDLEN + 1]; + int win; + int lose; + int tie; +} chcusr_t; + +#define CHC_ACT_BOARD 0x1 /* set if transfered board to this sock */ + +typedef struct chc_act_list{ + int sock; + struct chc_act_list *next; +} chc_act_list; + diff --git a/include/proto.h b/include/proto.h index bbb603df..5c287dd1 100644 --- a/include/proto.h +++ b/include/proto.h @@ -164,24 +164,11 @@ int card_99(); /* chat */ int t_chat(); -/* chc_draw */ -void chc_drawline(board_t board, chcusr_t *user1, chcusr_t *user2, int line); -void chc_movecur(int r, int c); -void chc_redraw(chcusr_t *user1, chcusr_t *user2, board_t board); - -/* chc_net */ -void chc_sendmove(int s); -int chc_recvmove(int s); - -/* chc_play */ +/* chc */ void chc(int s, int mode); - -/* chc_rule */ -void chc_movechess(board_t board); -int chc_canmove(board_t board, rc_t from, rc_t to); -int chc_iskfk(board_t board); -int chc_ischeck(board_t board, int turn); -void chc_init_board(board_t board); +int chc_main(void); +int chc_personal(void); +int chc_watch(void); /* chicken */ int show_file(char *filename, int y, int lines, int mode); |