BilliardsDoc.h
上传用户:sycq158
上传日期:2008-10-22
资源大小:15361k
文件大小:2k
- // BilliardsDoc.h : interface of the CBilliardsDoc class
- //
- /////////////////////////////////////////////////////////////////////////////
- #if !defined(AFX_BILLIARDSDOC_H__44D559A0_930E_46BD_A6AA_8C6E34F57AA3__INCLUDED_)
- #define AFX_BILLIARDSDOC_H__44D559A0_930E_46BD_A6AA_8C6E34F57AA3__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "ListenSocket.h"
- #include "ClientSocket.h"
- class CClientSocket;
- class CListenSocket;
- #define SERVER 0
- #define CLIENT 1
- #define IDLE 2
- //NAME '0'
- //MSG '1'
- //SHOOT '2'
- //QUIT '3'
- class CBilliardsDoc : public CDocument
- {
- protected: // create from serialization only
- CBilliardsDoc();
- DECLARE_DYNCREATE(CBilliardsDoc)
- // Attributes
- public:
- CListenSocket* m_pListenSocket;
- CClientSocket* m_pClientSocket;
-
- BOOL m_bPlayer;
- CString m_strClient;
- CString m_strServer;
- // Operations
- public:
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CBilliardsDoc)
- public:
- virtual BOOL OnNewDocument();
- virtual void Serialize(CArchive& ar);
- //}}AFX_VIRTUAL
- // Implementation
- public:
- void ReceiveVelocity(char *pBuf);
- BOOL ReceiveMSG(CString strTemp);
- BOOL AcceptConnection();
- void SendVelocity(float m_fVelocity[3]);
-
- virtual ~CBilliardsDoc();
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
- protected:
- // Generated message map functions
- protected:
- //{{AFX_MSG(CBilliardsDoc)
- // NOTE - the ClassWizard will add and remove member functions here.
- // DO NOT EDIT what you see in these blocks of generated code !
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- struct Velocity{
- char type;
- float fvalue0;
- float fvalue1;
- float fvalue2;
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_BILLIARDSDOC_H__44D559A0_930E_46BD_A6AA_8C6E34F57AA3__INCLUDED_)