Bomber.h
上传用户:royluo
上传日期:2007-01-05
资源大小:1584k
文件大小:3k
源码类别:

游戏

开发平台:

Visual C++

  1. /*****************************************************************************
  2. *                                                                             
  3. *   Bomber.h
  4. *                                                                             
  5. *   Electrical Engineering Faculty - Software Lab                             
  6. *   Spring semester 1998                                                      
  7. *                                                                             
  8. *   Tanks game                                                                
  9. *                                                                             
  10. *   Module description: Interface of the bomber game object.
  11. *                       
  12. *                                                                             
  13. *   Authors: Eran Yariv - 28484475                                           
  14. *            Moshe Zur  - 24070856                                           
  15. *                                                                            
  16. *                                                                            
  17. *   Date: 23/09/98                                                           
  18. *                                                                            
  19. ******************************************************************************/
  20. #ifndef _BOMBER_OBJECT_H_
  21. #define _BOMBER_OBJECT_H_
  22. #include "GameConsts.h"
  23. #include "GameObject.h"
  24. #include "ImageManager.h"
  25. #include "ManouverSet.h"
  26. #include "Timer.h"
  27. #include "GameObjectsList.h"
  28. #include "MsgQueue.h"
  29. #include "TankObj.h"
  30. #include "Bomb.h"
  31. class CBomber : public CMovingGameObject
  32. {
  33. public:
  34.     CBomber (CTankObj *pParent);    // Creates a bomber is setup mode
  35.     CBomber (UINT uDirInd,          // Creates a bomber in flight mode
  36.              UINT uXPos,
  37.              UINT uYPos,
  38.              DWORD dwInitFlightTime);
  39.     ~CBomber ();
  40.     StateType           CalcState (DWORD dwCurTime);
  41.     ObjectHeightType    GetHeight();
  42.     HIMAGE              GetImage();
  43.     CReaction           React(CGameObject *pTo);
  44.     GameObjectType      GetType();
  45.     BOOL                IsLocal ();
  46. private:
  47.     typedef enum {
  48.         BOMBER_STATE_SETUP,        // Setup mode
  49.         BOMBER_STATE_FLYING,       // Flying mode
  50.         BOMBER_STATE_DEAD          // Dead now
  51.     } BomberStateType;
  52.         // images:
  53.     HIMAGE          m_hImage;           // handle to a bitmap of a bomber
  54.         // keyboard:                    
  55.     CManouverSet  * m_pManouverSet;     // points to manouver set in game manager
  56.         // manouvers:                   
  57.     DWORD           m_dwLastMoveTick;   // last time a we moved (in setup) or dropped a bomb (in flying)
  58.         // properties:
  59.     CTankObj      * m_pFather;                
  60.     BOOL            m_bLocal;           // Are we a local or remote bomber?
  61.     BomberStateType m_State;
  62.     DWORD           m_dwInitialTime;    // Flight start time 
  63.     CPoint          m_InitialPos;       // Flight start point
  64.     UINT            m_uEdgePos;         // Position on map edge
  65.         // aliases:
  66.     CMsgQueue     & m_MsgQueue;
  67.     TIMER_CLASS   & m_Timer;
  68.     CPoint CalcEdgePos ();
  69.     void   FixEdgeDirection ();
  70.     BOOL   FindBombPos (CPoint &ResPos, DWORD dwTimeGap);
  71.     void   SendBomberMsg(); 
  72. };
  73. #include "Bomber.inl"
  74. #endif