add board_canHint

This commit is contained in:
Andy2 2010-07-07 18:47:02 -07:00
parent a2e4fd09c4
commit ac6dc400ce
2 changed files with 14 additions and 1 deletions

View file

@ -537,12 +537,24 @@ board_canShuffle( const BoardCtxt* board )
TRAY_REVEALED == board->trayVisState );
}
XP_Bool board_canTogglePending( const BoardCtxt* board )
XP_Bool
board_canTogglePending( const BoardCtxt* board )
{
return TRAY_REVEALED == board->trayVisState
&& model_canTogglePending( board->model, board->selPlayer );
}
XP_Bool
board_canHint( const BoardCtxt* board )
{
XP_Bool canHint = !board->gi->hintsNotAllowed;
if ( canHint ) {
LocalPlayer* lp = &board->gi->players[board->selPlayer];
canHint = lp->isLocal && !lp->isRobot;
}
return canHint;
}
static XP_U16
adjustOffset( XP_U16 curOffset, XP_S16 zoomBy )
{

View file

@ -81,6 +81,7 @@ XP_U16 board_getYOffset( const BoardCtxt* board );
XP_Bool board_canFlip( const BoardCtxt* board );
XP_Bool board_canShuffle( const BoardCtxt* board );
XP_Bool board_canTogglePending( const BoardCtxt* board );
XP_Bool board_canHint( const BoardCtxt* board );
/* zoomBy: >0: zoom in; < 0: zoom out; 0: query only */
XP_Bool board_zoom( BoardCtxt* board, XP_S16 zoomBy, XP_Bool* canInOut );