www.pudn.com > renju_src.rar > RenjuView.h
// RenjuView.h : interface of the CRenjuView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_RENJUVIEW_H__BB3CDB64_67AE_47D0_9619_6D9A8CC73189__INCLUDED_)
#define AFX_RENJUVIEW_H__BB3CDB64_67AE_47D0_9619_6D9A8CC73189__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ListenSocket.h"
#include "ClientSocket.h"
#include "Midi.h"
class CRenjuView : public CView
{
protected: // create from serialization only
CRenjuView();
DECLARE_DYNCREATE(CRenjuView)
// Attributes
public:
CRenjuDoc* GetDocument();
CListenSocket* m_pListenSocket;
CClientSocket* m_pClientSocket;
CClientSocket* m_pClientSocket2;
BOOL m_bMyTurn;
BOOL m_bLinked;
BOOL m_bOpponentWin;
BOOL m_bInGame;
int m_nColor;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CRenjuView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
public:
void DrawPieces();
BOOL IsWin(int x, int y);
void DestroyClientSocket2();
void DestroyClientSocket();
void CreateClientSocket(CString& strAddress);
void DestroyListenSocket();
void CreateListenSocket();
void ResetCoords();
void OneStep(int x, int y);
void RequestAccepted(int accept);
virtual ~CRenjuView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
int m_nCoords[DIVISIONS][DIVISIONS];
CPoint m_ptLastStep;
BOOL m_bMusicOn;
CMidi m_midi;
// Generated message map functions
protected:
void PlayBGMusic(LPCSTR FileName);
//{{AFX_MSG(CRenjuView)
afx_msg void OnPaint();
afx_msg void OnActionLink();
afx_msg void OnUpdateActionLink(CCmdUI* pCmdUI);
afx_msg void OnActionDislink();
afx_msg void OnUpdateActionDislink(CCmdUI* pCmdUI);
afx_msg void OnActionSurrender();
afx_msg void OnUpdateActionSurrender(CCmdUI* pCmdUI);
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnActionNew();
afx_msg void OnUpdateActionNew(CCmdUI* pCmdUI);
afx_msg void OnMusicMusic();
afx_msg void OnUpdateMusicMusic(CCmdUI* pCmdUI);
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_MSG
afx_msg LRESULT OnNewGame(WPARAM wParam, LPARAM lParam);
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in RenjuView.cpp
inline CRenjuDoc* CRenjuView::GetDocument()
{ return (CRenjuDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_RENJUVIEW_H__BB3CDB64_67AE_47D0_9619_6D9A8CC73189__INCLUDED_)