game.h

来自「黑白道游戏源码,VC环境编写」· C头文件 代码 · 共 63 行

H
63
字号
//			FILE: Game.h: interface for the CGame class.
//		write by: fatehost
//			date: 2004-1-16
//	 description: 这是一个黑白道游戏
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_GAME_H__FA12D20C_E8E0_4B83_8D59_785DE567056E__INCLUDED_)
#define AFX_GAME_H__FA12D20C_E8E0_4B83_8D59_785DE567056E__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define XSIZE 5
#define YSIZE 5

class CGame  
{
private:
	int m_uGameAry[XSIZE][YSIZE];//原始数组,保存开始状态
	int m_uTempAry[XSIZE][YSIZE];//保存玩家每一步状态	
public:
	CGame();
	virtual ~CGame();

	/************************************************
	*
	*初始化数组
	*
	*************************************************/
	void InitGameAry();
	
	/************************************************
	*
	*玩家点击x,y处。根据黑白道游戏规则改变数组
	*ary[x][y]=nValue
	*************************************************/
	bool SetTempGameAry(int x,int y,int nValue);

	/************************************************
	*
	*获取数组值,错误返回-1
	*
	*************************************************/
	int GetTempGameAry(int x,int y);

	/************************************************
	*
	*获取最初数组值,错误返回-1
	*
	*************************************************/
	int GetOrgAry(int x , int y);

	/************************************************
	*
	*重来
	*
	*************************************************/
	void RePlay();
};

#endif // !defined(AFX_GAME_H__FA12D20C_E8E0_4B83_8D59_785DE567056E__INCLUDED_)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?