home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_C / MSVCPUZL.ZIP / PUZZLVW.H < prev    next >
C/C++ Source or Header  |  1993-11-09  |  2KB  |  66 lines

  1. // puzzlvw.h : interface of the CPuzzleView class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. #ifndef __PUZZLVW_H
  5. #define __PUZZLVW_H
  6. #include "piece.h"
  7.  
  8. class CPuzzleView : public CView
  9. {
  10. protected: // create from serialization only
  11.     CPuzzleView();
  12.     DECLARE_DYNCREATE(CPuzzleView)
  13.  
  14. // Attributes
  15. public:
  16.     CPuzzleDoc* GetDocument();
  17.  
  18. // Operations
  19. public:
  20.  
  21. // Implementation
  22. public:
  23.     virtual ~CPuzzleView();
  24.     virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  25.     //virtual BOOL PreCreateWindow(CREATESTRUCT&);
  26.     
  27. #ifdef _DEBUG
  28.     virtual void AssertValid() const;
  29.     virtual void Dump(CDumpContext& dc) const;
  30. #endif
  31.  
  32. private:
  33.   CObArray m_board;
  34.   int      m_width;
  35.   int      m_height;
  36.   CPoint   m_mousePos;
  37.   BOOL     m_bCaptured;
  38.   
  39.   CPiece*  m_selectedPiece;
  40.  
  41.   BOOL     CanMove(CPiece*);
  42.   BOOL     OnBoard(CPoint&,CPiece*);
  43.   BOOL     Conflict(CPoint&,CPiece*);
  44.   void     ResetPieces(void);
  45.   void     SizeToPuzzle(void);
  46.  
  47. // Generated message map functions
  48. protected:
  49.     //{{AFX_MSG(CPuzzleView)
  50.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  51.     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  52.     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  53.     afx_msg void OnReset();
  54.     afx_msg void OnUpdateReset(CCmdUI* pCmdUI);
  55.     //}}AFX_MSG
  56.     DECLARE_MESSAGE_MAP()
  57. };
  58.  
  59. #ifndef _DEBUG  // debug version in puzzlvw.cpp
  60. inline CPuzzleDoc* CPuzzleView::GetDocument()
  61.    { return (CPuzzleDoc*) m_pDocument; }
  62. #endif
  63.  
  64. #endif //__PUZZLVW_H
  65.  
  66.