Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

126 lines
3.5 KiB

  1. /*************************************************
  2. * blockdoc.h *
  3. * *
  4. * Copyright (C) 1995-1999 Microsoft Inc. *
  5. * *
  6. *************************************************/
  7. // blockdoc.h : interface of the CBlockDoc class
  8. //
  9. /////////////////////////////////////////////////////////////////////////////
  10. class CSlotManager;
  11. class CBlock;
  12. class CSpriteList;
  13. class CDIB;
  14. class CBlockDoc : public CDocument
  15. {
  16. protected: // create from serialization only
  17. CBlockDoc();
  18. DECLARE_DYNCREATE(CBlockDoc)
  19. CBlock* LoadBlock(UINT idRes,
  20. int iMass,
  21. int iX, int iY,
  22. int iVX, int iVY);
  23. // Attributes
  24. public:
  25. CDIB* GetBackground() {return m_pBkgndDIB;}
  26. CSpriteList* GetSpriteList() {return &m_SpriteList;}
  27. void GetSceneRect(CRect* prc);
  28. void Land();
  29. void Tick();
  30. void Remove(CBlock* pBlock);
  31. int MyRand() {return(rand() + m_nSeed);}
  32. int GetNumofRows() const {return m_nRow;}
  33. int GetNumofCols() const {return m_nCol;}
  34. int GetRowHeight() const {return m_nRowHeight;}
  35. int GetColWidth() const {return m_nColWidth;}
  36. int GetExpertise() const {return m_nExpertise;}
  37. void Promote();
  38. char* GetChar();
  39. void GenerateBlock(int nSlotNo);
  40. void GameOver(BOOL bHighScore=FALSE);
  41. void Hit(WORD wCode);
  42. void SoundHit();
  43. void SoundAppear();
  44. void SoundGround();
  45. void SoundFire();
  46. void SoundOver();
  47. int GetTotalWords() const {return m_nTotalWords;}
  48. int GetTotalHitWords() const {return m_nTotalHitWords;}
  49. int GetWordHitInAir() const {return m_nHitInMoving;}
  50. int GetWordHitInGround() const {return m_nHitInStill;}
  51. int GetMissedHit() const {return m_nMissedHit;}
  52. WORD GetFocusChar(CPoint pt);
  53. BOOL GetKeyStroke(WORD wCode);
  54. // Operations
  55. public:
  56. BOOL SetBackground(CDIB* pDIB);
  57. void SoundClick()
  58. {}
  59. // Overrides
  60. // ClassWizard generated virtual function overrides
  61. //{{AFX_VIRTUAL(CBlockDoc)
  62. public:
  63. virtual BOOL OnNewDocument();
  64. virtual void DeleteContents();
  65. //}}AFX_VIRTUAL
  66. // Implementation
  67. public:
  68. virtual ~CBlockDoc();
  69. virtual void Serialize(CArchive& ar); // overridden for document i/o
  70. #ifdef _DEBUG
  71. virtual void AssertValid() const;
  72. virtual void Dump(CDumpContext& dc) const;
  73. #endif
  74. protected:
  75. CDIB* m_pBkgndDIB; // ptr to background DIB
  76. CBlock* m_pdibArrow;
  77. CSpriteList m_SpriteList; // sprite list
  78. CBlockView* GetBlockView(); // helper fn.
  79. int m_nRow;
  80. int m_nCol;
  81. int m_nRowHeight;
  82. int m_nColWidth;
  83. BOOL m_bSound;
  84. BOOL m_nExpertise;
  85. int m_nTotalWords;
  86. int m_nTotalHitWords;
  87. int m_nMissedHit;
  88. int m_nHitInMoving;
  89. int m_nHitInStill;
  90. int m_nSeed;
  91. CBitmap m_bmBlock;
  92. CSlotManager* m_pSlotManager;
  93. // Generated message map functions
  94. protected:
  95. //{{AFX_MSG(CBlockDoc)
  96. afx_msg void OnOPTIONSIZE12x10();
  97. afx_msg void OnOPTIONSIZE16x16();
  98. afx_msg void OnOPTIONSIZE4x4();
  99. afx_msg void OnTestSound();
  100. afx_msg void OnOptionBeginer();
  101. afx_msg void OnUpdateOptionBeginer(CCmdUI* pCmdUI);
  102. afx_msg void OnOptionExpert();
  103. afx_msg void OnUpdateOptionExpert(CCmdUI* pCmdUI);
  104. afx_msg void OnUpdateOptionOrdinary(CCmdUI* pCmdUI);
  105. afx_msg void OnOptionOrdinary();
  106. afx_msg void OnOptionSound();
  107. afx_msg void OnUpdateOptionSound(CCmdUI* pCmdUI);
  108. afx_msg void OnFileStatistic();
  109. afx_msg void OnTest();
  110. //}}AFX_MSG
  111. DECLARE_MESSAGE_MAP()
  112. };
  113. #define LEVEL_EXPERT 3
  114. #define LEVEL_ORDINARY 2
  115. #define LEVEL_BEGINNER 1
  116. /////////////////////////////////////////////////////////////////////////////