/*===========================================================================
FILE: five.c
===========================================================================*/
/*===============================================================================
INCLUDES AND VARIABLE DEFINITIONS
=============================================================================== */
#include "AEEModGen.h" // Module interface definitions
#include "AEEAppGen.h" // Applet interface definitions
#include "AEEShell.h" // Shell interface definitions
#include "AEEFile.h" // File interface definitions
#include "AEEDB.h" // Database interface definitions
#include "AEENet.h" // Socket interface definitions
#include "AEESound.h" // Sound Interface definitions
#include "AEETapi.h" // TAPI Interface definitions
#include "five.bid"
#include "five_res.h"
#include "five.h"
/*-------------------------------------------------------------------
Applet structure. All variables in here are reference via "pMe->"
-------------------------------------------------------------------*/
// create an applet structure that's passed around. All variables in
// here will be able to be referenced as static.
typedef struct _five {
AEEApplet a ; // First element of this structure must be AEEApplet
AEEDeviceInfo DeviceInfo; // always have access to the hardware device information
IDisplay *pIDisplay; // give a standard way to access the Display interface
IShell *pIShell; // give a standard way to access the Shell interface
//棋盘和棋子图片
IImage *chessBoard;
IImage *chessBlack;
IImage *chessWhite;
//棋盘数组,0为无,1为黑,2为白
uint32 board[BOARD_WIDTH][BOARD_HEIGHT];
//当前下子位置
int32 x;
int32 y;
//当前下子类型,1为黑,2为白
byte chessType;
} five;
/*-------------------------------------------------------------------
Function Prototypes
-------------------------------------------------------------------*/
static boolean five_HandleEvent(five* pMe,
AEEEvent eCode, uint16 wParam,
uint32 dwParam);
boolean five_InitAppData(five* pMe);
void five_FreeAppData(five* pMe);
/*===============================================================================
FUNCTION DEFINITIONS
=============================================================================== */
/*===========================================================================
FUNCTION: AEEClsCreateInstance
DESCRIPTION
This function is invoked while the app is being loaded. All Modules must provide this
function. Ensure to retain the same name and parameters for this function.
In here, the module must verify the ClassID and then invoke the AEEApplet_New() function
that has been provided in AEEAppGen.c.
After invoking AEEApplet_New(), this function can do app specific initialization. In this
example, a generic structure is provided so that app developers need not change app specific
initialization section every time except for a call to IDisplay_InitAppData().
This is done as follows: InitAppData() is called to initialize AppletData
FILE: five.c
===========================================================================*/
/*===============================================================================
INCLUDES AND VARIABLE DEFINITIONS
=============================================================================== */
#include "AEEModGen.h" // Module interface definitions
#include "AEEAppGen.h" // Applet interface definitions
#include "AEEShell.h" // Shell interface definitions
#include "AEEFile.h" // File interface definitions
#include "AEEDB.h" // Database interface definitions
#include "AEENet.h" // Socket interface definitions
#include "AEESound.h" // Sound Interface definitions
#include "AEETapi.h" // TAPI Interface definitions
#include "five.bid"
#include "five_res.h"
#include "five.h"
/*-------------------------------------------------------------------
Applet structure. All variables in here are reference via "pMe->"
-------------------------------------------------------------------*/
// create an applet structure that's passed around. All variables in
// here will be able to be referenced as static.
typedef struct _five {
AEEApplet a ; // First element of this structure must be AEEApplet
AEEDeviceInfo DeviceInfo; // always have access to the hardware device information
IDisplay *pIDisplay; // give a standard way to access the Display interface
IShell *pIShell; // give a standard way to access the Shell interface
//棋盘和棋子图片
IImage *chessBoard;
IImage *chessBlack;
IImage *chessWhite;
//棋盘数组,0为无,1为黑,2为白
uint32 board[BOARD_WIDTH][BOARD_HEIGHT];
//当前下子位置
int32 x;
int32 y;
//当前下子类型,1为黑,2为白
byte chessType;
} five;
/*-------------------------------------------------------------------
Function Prototypes
-------------------------------------------------------------------*/
static boolean five_HandleEvent(five* pMe,
AEEEvent eCode, uint16 wParam,
uint32 dwParam);
boolean five_InitAppData(five* pMe);
void five_FreeAppData(five* pMe);
/*===============================================================================
FUNCTION DEFINITIONS
=============================================================================== */
/*===========================================================================
FUNCTION: AEEClsCreateInstance
DESCRIPTION
This function is invoked while the app is being loaded. All Modules must provide this
function. Ensure to retain the same name and parameters for this function.
In here, the module must verify the ClassID and then invoke the AEEApplet_New() function
that has been provided in AEEAppGen.c.
After invoking AEEApplet_New(), this function can do app specific initialization. In this
example, a generic structure is provided so that app developers need not change app specific
initialization section every time except for a call to IDisplay_InitAppData().
This is done as follows: InitAppData() is called to initialize AppletData