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

游戏

开发平台:

Visual C++

  1. /*****************************************************************************
  2. *                                                                             
  3. *   Reaction.inl
  4. *                                                                             
  5. *   Electrical Engineering Faculty - Software Lab                             
  6. *   Spring semester 1998                                                      
  7. *                                                                             
  8. *   Tanks game                                                                
  9. *                                                                             
  10. *   Contents: Inline functions implementations.
  11. *                                                                             
  12. *   Authors: Eran Yariv - 28484475                                           
  13. *            Moshe Zur  - 24070856                                           
  14. *                                                                            
  15. *                                                                            
  16. *   Date: 23/09/98                                                           
  17. *                                                                            
  18. ******************************************************************************/
  19. inline CReaction::CReaction (UINT uExplosionIntensity,
  20.                              TerrainType TerrainDifficulty,
  21.                              BonusType bt,
  22.                              UINT TankID) :
  23.     m_wReactionBits (WORD(uExplosionIntensity                            | 
  24.                           (TerrainDifficulty << REACTION_TERRAIN_SHIFT)  |
  25.                           (bt << REACTION_BONUS_SHIFT)                   |
  26.                           (TankID << REACTION_TANKID_SHIFT)))
  27. {}
  28. inline UINT CReaction::GetExplosionIntensity ()
  29. {
  30.     return UINT(m_wReactionBits & REACTION_EXPLOSION_MASK);
  31. }
  32. inline TerrainType CReaction::GetTerrainDifficulty  ()
  33. {
  34.     return TerrainType((m_wReactionBits & REACTION_TERRAIN_MASK) 
  35.                 >> REACTION_TERRAIN_SHIFT);
  36. }
  37. inline BonusType CReaction::GetBonusType ()
  38.     return BonusType((m_wReactionBits & REACTION_BONUS_MASK) 
  39.                 >> REACTION_BONUS_SHIFT);
  40. }
  41. inline UINT CReaction::GetTankID ()
  42.     return UINT((m_wReactionBits & REACTION_TANKID_MASK) 
  43.                 >> REACTION_TANKID_SHIFT);
  44. }