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

游戏

开发平台:

Visual C++

  1. /*****************************************************************************
  2. *                                                                             
  3. *   KeysTable.h
  4. *                                                                             
  5. *   Electrical Engineering Faculty - Software Lab                             
  6. *   Spring semester 1998                                                      
  7. *                                                                             
  8. *   Tanks game                                                                
  9. *                                                                             
  10. *   Module description: Implements the table of keys in use to control the 
  11. *                       tank. Maps between the virtual key code and the action.
  12. *                       
  13. *                                                                             
  14. *   Authors: Eran Yariv - 28484475                                           
  15. *            Moshe Zur  - 24070856                                           
  16. *                                                                            
  17. *                                                                            
  18. *   Date: 23/09/98                                                           
  19. *                                                                            
  20. ******************************************************************************/
  21. #ifndef _KEYS_TABLE_H_
  22. #define _KEYS_TABLE_H_
  23. #include <ManouverSet.h>
  24. class CKeysTable
  25. {
  26. public:
  27.     CKeysTable();                       
  28.     ~CKeysTable();                      // Store default keys to registry
  29.     CKeysTable (const CKeysTable& rhs); // Copy ctor
  30.     CKeysTable& operator= (const CKeysTable& rhs);
  31.     UINT GetKey (int ind) const;
  32.     BOOL SetKey (int ind, UINT key);    // Checks key's uniqness
  33.     void RestoreDefault();              // Get default keys from Game consts
  34.     void InitTable();                   // Get keys' bindings from registry
  35. private:
  36.     UINT m_uKeysArr[CManouverSet::MAX_MANOUVER_BIT];
  37.     BOOL m_fInitDone;                   // Set to true after RestoreDefault has accomplished
  38. };
  39. #include <KeysTable.inl>
  40. #endif