⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chessarray.h

📁 这是一个能够远程下中国象棋的程序
💻 H
字号:
// ChessArray.h: interface for the CChessArray class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_CHESSARRAY_H__805668C6_532C_11D4_BDEB_0000E8E83B61__INCLUDED_)
#define AFX_CHESSARRAY_H__805668C6_532C_11D4_BDEB_0000E8E83B61__INCLUDED_

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

typedef struct 
{
	CPoint point;
	char string[3];
}CHESSMAN, *PCHESSMAN;

class CChessArray : public CObject  
{
	friend class CPointArray;
	DECLARE_DYNAMIC(CChessArray)
public:
	CChessArray();
	void InitArray(int iCount);
	CChessArray(CChessArray &chessArray);
	CChessArray & operator= (CChessArray &chessArray);
	virtual ~CChessArray();
private:
	PCHESSMAN m_pChessman;
	int m_iCount;
public:
	int GetCount(){return m_iCount;}
	PCHESSMAN GetPoint(){return m_pChessman;}
	CPoint GetPointOrg(int iCount);
	void SetPoint(PCHESSMAN p){m_pChessman = p;}
	void SetChessman(int icount, CHESSMAN man);
	PCHESSMAN GetChessman(int iCount);
	void SetChessmanValue(int iCount, char*p);
	void SetChessmanPoint(int iCount, CPoint point);
};

class CPointArray
{
public:
	CPoint *m_pointArray;
	CPoint *m_pointOpponent;
public:
	CPointArray();
	~CPointArray();
	void SetValue(CChessArray &chess1, CChessArray &chess2);
	
public:
	BOOL IsPointCorrect(int iCount, CPoint &point);
private:
	BOOL IsCorrectVehicle(int iCount, CPoint &point);
	BOOL IsCorrectHorse(int iCount, CPoint &point);
	BOOL IsCorrectElephant(int iCount, CPoint &point);
	BOOL IsCorrectScholar(int iCount, CPoint &point);
	BOOL IsCorrectGeneral(int iCount, CPoint &point);
	BOOL IsCorrectGun(int iCount, CPoint &point);
	BOOL IsCorrectSoldier(int iCount, CPoint &point);

	BOOL PtInRgn(int iChessman, int iCount, CPoint *pPoint, CPoint &point);
	BOOL IsInChessman(CPoint point);

};

#endif // !defined(AFX_CHESSARRAY_H__805668C6_532C_11D4_BDEB_0000E8E83B61__INCLUDED_)

⌨️ 快捷键说明

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