home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
games
/
volume13
/
okbridge
/
part07
/
display.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-01-12
|
6KB
|
165 lines
/* display.h
!
! Copyright (C) 1990,1991 by Matthew Clegg
!
! This program may be copied and distributed freely. Please do not
! charge money for this program or for any program derived from it.
! If you modify this program, then include a notice stating plainly
! that your program is derived from the okbridge program and is not
! the same as the official okbridge program.
!
! I welcome any suggestions for improvement to okbridge, and
! I would be especially happy to receive improved source code.
! If you have comments or suggestions, or if you would like to
! join the okbridge mailing list, then write to
!
! mclegg@cs.ucsd.edu
!
*
* The DISPLAY module for the bridge program is responsible for
* presenting the information regarding various aspects of the
* game to the screen. The organization of the screen is embedded
* within this module, and there are entry points for giving
* updates to the screen at each step of the game.
*
* This module does not make any calls to the operating system
* directly. Instead, all of its output functions are channeled
* through the TERMINAL module.
*
*/
extern Initialize_Display ();
/* Should be called once when the program starts up. */
extern Reset_Display ();
/* Redraws the main features of the screen. Used in the process
of doing a 'refresh'. */
extern Refresh_Display ();
/* Updates the entire screen. */
/* The scoring display gives information about the following attributes
* for each side:
*
* -- The number of tricks taken in the current hand.
* -- The current 'above the line' score.
* -- The current 'below the line' score.
* -- The vulnerabilities of each side.
*
* Nov. 3, 1990: The scoring display routines have now been revised to
* present the display in the Chicago-scoring format as well as in the
* rubber-scoring format. The decision is made by inspecting the
* variable rubber_scoring defined in globals.h.
*/
extern Display_Tricks_Taken ();
extern Display_Above_Line_Points ();
extern Display_Below_Line_Points ();
extern Display_Vulnerabilities ();
/* The bidding display is given as four columns, similar to that found
* in many bridge books. At the top of each column is printed the
* corresponding input parameter string to identify the bidder.
*
* Before bidding can begin, the bidding display must be initialized.
* Then, for each bid, that bid must be shown on the display. And after
* the bids have been made, the contract must be displayed. Thus,
* we have the following procedures:
*
* Display_Bidding_Board: Called to initialize the bidding display.
* This procedure should be called once at the beginning of the bidding.
*
* Display_Hand_for_Bidding: Called to show what the local player is
* holding. This procedure should be called once after the call to
* Display_Bidding_Board.
*
* Display_Bidder: Called to show whose turn it is to bid now.
*
* Display_Bid: Called to show a player's bid. The current round of
* bidding and the player who has bid are passed as input parameters,
* but the actual bid is read from the global variable 'bids'.
*
* Clear_Bidding_Board: Called to erase the bidding display. This should
* be called once after the auction has concluded.
*
* Display_Contract: To be called after the auction is over. This
* procedure displays the contract which has been determined by the
* bidding.
*/
extern Display_Bidding_Board ();
extern Display_Hand_for_Bidding ();
extern Display_Bidder ();
extern Display_Bid ();
extern Clear_Bidding_Board ();
extern Display_Contract ();
/* The playing board is a separate display which runs during the play
* of the hands. In the center of the screen is displayed a large square
* which is supposed to represent the tabletop, and the cards which are
* played are shown on this table top.
*
* The playing proceeds also in a series of stages. First, there is an
* initial call to draw the playing board. Then, in each trick there are
* calls to show the cards which have been played. At the end of each
* trick, there is a final call to clear the cards from the playing board.
* And after all of the tricks have been played, the playing board is
* cleared. Thus, we have the following procedures:
*
* Display_Playing_Board: called initially to draw the playing board.
*
* Display_Hand: called at the beginning of each trick to display the
* contents of the (local) player's hand. The player whose hand is to
* be displayed is passed as input, mainly as an aid to debugging.
*
* Display_Player: called before each card is played to display whose
* it is to play next.
*
* Display_Play: called after each card has been played to display the
* card on the tabletop. The player and the card are passed as input.
*
* Clear_Hand: called intermittently to erase a player's hand from
* the display.
*
* Clear_Plays: called at the end of each trick to clear the cards from
* the tabletop.
*
* Clear_Playing_Board: called after all of the tricks have been played
* to clear the 'playing board' from the screen.
*
*/
extern Display_Playing_Board ();
extern Display_Hand ();
extern Display_Player ();
extern Display_Play ();
extern Clear_Plays ();
extern Clear_Hand ();
extern Clear_Playing_Board ();
/* One line of the display is reserved for displaying special messages about
* the status of the game. The following two procedures are given for
* manipulating this display.
*/
extern Display_Status ();
extern Clear_Status_Display ();
/* The bottom part of the screen is used for the exchange of comments
* between the players. The following procedures are used for managing
* this part of the display.
*/
extern Refresh_Player_Comments ();
extern Initialize_Player_Comments ();
extern Display_Player_Comment ();
extern Suspend_Comment_Display ();
extern Continue_Comment_Display ();