📄 cardgame.h
字号:
/************************************************
*
* $Copyright 2001 Joseph J. Lemieux ALL RIGHTS RESERVED. $
*
* $Filename: C:\OSEKBook\src\CH13\inc\cardgame.h $
*
* Description:
*
************************************************/
#ifndef CARDGAMEH
#define CARDGAMEH
#include "os.h"
#include "init.h"
#include "comapp.h"
/*
* Define the minimum number of cards in the deck
* that will trigger a new shuffle.
*/
#define GAME_MINIMUM_CARDS 10
/*
* Define the types of players.
*/
#define GAME_PLAYER 0
#define GAME_DEALER 1
/*
* States of the game defined
*/
typedef enum GameStatetag {
GAME_NORMAL,
GAME_PLAYER_TURN,
GAME_PLAYER_WAIT,
GAME_DEALER_TURN,
GAME_DEALER_WAIT,
GAME_SHUFFLING,
GAME_CONSTRUCT_OPPONENT_MESSAGE,
GAME_RECEIVED_OPPONENT_MESSAGE,
GAME_RECEIVING_OPPONENT_MESSAGE,
GAME_AWAITING_RESPONSE
}GameState;
/*
* Possible transitions that may
* occur when a key is pressed.
*/
typedef enum GameTransitionstag {
START_SHUFFLING,
DEAL_PLAYER_CARD,
END_PLAYER_TURN,
DEAL_DEALER_CARD,
NEW_GAME,
REQUEST_MULTIPLE,
CANCEL_REQUEST,
ACCEPT_REQUEST,
REJECT_REQUEST,
REQUEST_CARD_DEALT,
RELINQUISH_TURN,
DEAL_MULTI_CARD,
NEW_MULTI_GAME,
CANCEL_MULTI,
SEND_PLAYER,
CREATE_OPPONENT_MESSAGE,
ENTER_LETTER_RANGE,
ENTER_LETTER_EXACT,
ENTER_SPACE,
ENTER_PERIOD,
SEND_OPPONENT_MESSAGE,
CLEAR_OPPONENT_MESSAGE,
NO_ACTION
}GameTransitions;
/*
* Types of requests allowed in message
*/
typedef enum RequestModeMessageValuestag {
REQUEST_HEAD_TO_HEAD,
ACCEPT_HEAD_TO_HEAD,
REJECT_HEAD_TO_HEAD,
CANCEL_HEAD_TO_HEAD,
SWITCH_DEALER,
DEAL_NEW_HAND
}RequestModeMessageValues;
/************************************************
*
* Function: GetGameState
*
* Inputs: None
*
* Outputs: None
*
* Returns: Current Game State
*
* Description: Determines current game state and returns it.
*
************************************************/
GameState GetGameState(void);
/************************************************
*
* Function: InitGame
*
* Inputs: type - Type of initialization
*
* Outputs: Mode specific variable are set here
*
* Returns: None
*
* Description: This routine initializes the state of the
* game based upon the type of mode and the device
* which is either Node0 or Node1
*
************************************************/
void InitGame(InitType type);
#endif /* CARDGAMEH */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -