diff options
author | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-09-11 01:30:22 +0800 |
---|---|---|
committer | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-09-11 01:30:22 +0800 |
commit | f1c53390c4817e5f9552588f298808764ef1bc65 (patch) | |
tree | 6410c5100306d7aa816f796ad0f2865a76e64e8b /include/chess.h | |
parent | 3a13adbea9793d58c961c3fc869fd1f79fdedad3 (diff) | |
download | pttbbs-f1c53390c4817e5f9552588f298808764ef1bc65.tar pttbbs-f1c53390c4817e5f9552588f298808764ef1bc65.tar.gz pttbbs-f1c53390c4817e5f9552588f298808764ef1bc65.tar.bz2 pttbbs-f1c53390c4817e5f9552588f298808764ef1bc65.tar.lz pttbbs-f1c53390c4817e5f9552588f298808764ef1bc65.tar.xz pttbbs-f1c53390c4817e5f9552588f298808764ef1bc65.tar.zst pttbbs-f1c53390c4817e5f9552588f298808764ef1bc65.zip |
GO convertion to chess framework
* versus, personal and watching all work
chess.c framework update
* "pass" and "tie request" are distinguished
* chess-specific key binding
* post-game processing
!!!NOTE!!! Chess protocals are NOT backward compatible
RESTART WHOLE system to ensure correctness
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3153 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'include/chess.h')
-rw-r--r-- | include/chess.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/include/chess.h b/include/chess.h index 8384e225..f51dfa5b 100644 --- a/include/chess.h +++ b/include/chess.h @@ -97,7 +97,7 @@ typedef struct ChessInfo { const char myturn; /* §Ú¤èÃC¦â */ char turn; - char ipass, hepass; + char pass[2]; char warnmsg[64]; char last_movestr[36]; char *photo; @@ -128,11 +128,13 @@ typedef struct ChessActions { void (*drawline) (const ChessInfo* info, int line); void (*movecur) (int r, int c); void (*prepare_play)(ChessInfo* info); + int (*process_key) (ChessInfo* info, int key, ChessGameResult* result); int (*select) (ChessInfo* info, rc_t location, ChessGameResult* result); void (*prepare_step)(ChessInfo* info, const void* step); - ChessGameResult (*apply_step) (void* board, const void* step); + ChessGameResult (*apply_step)(void* board, const void* step); void (*drawstep) (ChessInfo* info, const void* step); + ChessGameResult (*post_game)(ChessInfo* info); /* ending */ void (*gameend) (ChessInfo* info, ChessGameResult result); @@ -144,6 +146,7 @@ typedef struct ChessConstants { int traditional_timeout; int board_height; int board_width; + int pass_is_step; const char *chess_name; const char *photo_file_name; const char *log_board; @@ -154,7 +157,13 @@ typedef struct ChessConstants { typedef enum { CHESS_STEP_NORMAL, CHESS_STEP_PASS, CHESS_STEP_DROP, CHESS_STEP_FAILURE, - CHESS_STEP_NOP, /* for wake up */ + CHESS_STEP_SPECIAL, /* chesses' special steps */ + CHESS_STEP_NOP, /* for wake up */ + + CHESS_STEP_TIE, /* tie request */ + CHESS_STEP_TIE_ACC, /* accept */ + CHESS_STEP_TIE_REJ, /* reject */ + CHESS_STEP_UNDO, /* undo request */ CHESS_STEP_UNDO_ACC, /* accept */ CHESS_STEP_UNDO_REJ, /* reject */ @@ -185,7 +194,8 @@ void ChessEstablishRequest(int sock); void ChessAcceptingRequest(int sock); void ChessShowRequest(void); +void ChessRedraw(const ChessInfo* info); void ChessDrawLine(const ChessInfo* info, int line); -void ChessDrawExtraInfo(const ChessInfo* info, int line); +void ChessDrawExtraInfo(const ChessInfo* info, int line, int space); #endif /* INCLUDE_CHESS_H */ |