probetypeigc.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /*
  2. ** Copyright (C) 1996, 1997 Microsoft Corporation. All Rights Reserved.
  3. **
  4. ** File: probeTypeIGC.h
  5. **
  6. ** Author:
  7. **
  8. ** Description:
  9. ** Header for the CprobeTypeIGC class. This file was initially created by
  10. ** the ATL wizard.
  11. **
  12. ** History:
  13. */
  14. // probeTypeIGC.h : Declaration of the CprobeTypeIGC
  15. #ifndef __PROBETYPEIGC_H_
  16. #define __PROBETYPEIGC_H_
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CprobeTypeIGC
  19. class CprobeTypeIGC : public IprobeTypeIGC
  20. {
  21. #ifdef _DEBUG_CprobeTypeIGC_AddRef_Release
  22. public:
  23. DWORD __stdcall AddRef(void)
  24. {
  25. DWORD dwRefs = IprobeTypeIGC::AddRef();
  26. debugf("CprobeTypeIGC::AddRef(): m_count = %d\n", dwRefs);
  27. return dwRefs;
  28. }
  29. DWORD __stdcall Release(void)
  30. {
  31. DWORD dwRefs = IprobeTypeIGC::Release();
  32. debugf("CprobeTypeIGC::Release(): m_count = %d\n", dwRefs);
  33. return dwRefs;
  34. }
  35. #endif // _DEBUG
  36. public:
  37. CprobeTypeIGC(void)
  38. :
  39. m_projectileType(NULL)
  40. {
  41. }
  42. ~CprobeTypeIGC(void)
  43. {
  44. assert (m_projectileType == NULL);
  45. }
  46. // IbaseIGC
  47. virtual HRESULT Initialize(ImissionIGC* pMission, Time now, const void* data, int dataSize);
  48. virtual void Terminate(void)
  49. {
  50. if (m_projectileType)
  51. {
  52. m_projectileType->Release();
  53. m_projectileType = NULL;
  54. }
  55. m_pMission->DeleteExpendableType(this);
  56. }
  57. virtual void Update(Time now)
  58. {
  59. }
  60. virtual int Export(void* data) const;
  61. virtual ObjectType GetObjectType(void) const
  62. {
  63. return OT_probeType;
  64. }
  65. virtual ObjectID GetObjectID(void) const
  66. {
  67. return m_data.expendabletypeID;
  68. }
  69. // ItypeIGC
  70. virtual const void* GetData(void) const
  71. {
  72. return &m_data;
  73. }
  74. // IexpendableTypeIGC
  75. virtual const LauncherDef* GetLauncherDef(void) const
  76. {
  77. return &(m_data.launcherDef);
  78. }
  79. virtual EquipmentType GetEquipmentType(void) const
  80. {
  81. return ET_Dispenser;
  82. }
  83. virtual float GetLoadTime(void) const
  84. {
  85. return m_data.loadTime;
  86. }
  87. virtual float GetMass(void) const
  88. {
  89. return m_data.launcherDef.mass;
  90. }
  91. virtual float GetLifespan(void) const
  92. {
  93. return m_data.lifespan;
  94. }
  95. virtual float GetSignature(void) const
  96. {
  97. return m_data.signature;
  98. }
  99. virtual HitPoints GetHitPoints(void) const
  100. {
  101. return m_data.hitPoints;
  102. }
  103. virtual DefenseTypeID GetDefenseType(void) const
  104. {
  105. return m_data.defenseType;
  106. }
  107. virtual char const* GetName(void) const
  108. {
  109. return m_data.launcherDef.name;
  110. }
  111. virtual char const* GetModelName(void) const
  112. {
  113. return m_data.modelName;
  114. }
  115. virtual char const* GetModelTexture(void) const
  116. {
  117. return m_data.textureName;
  118. }
  119. virtual float GetRadius(void) const
  120. {
  121. return m_data.radius;
  122. }
  123. virtual ExpendableAbilityBitMask GetCapabilities(void) const
  124. {
  125. return m_data.eabmCapabilities;
  126. }
  127. virtual bool HasCapability(ExpendableAbilityBitMask eabm) const
  128. {
  129. return (m_data.eabmCapabilities & eabm) != 0;
  130. }
  131. // IprobeTypeIGC
  132. virtual float GetScannerRange(void) const
  133. {
  134. return m_data.scannerRange;
  135. }
  136. virtual float GetDtBurst(void) const
  137. {
  138. return m_data.dtimeBurst;
  139. }
  140. virtual float GetDispersion(void) const
  141. {
  142. return m_data.dispersion;
  143. }
  144. virtual float GetAccuracy(void) const
  145. {
  146. return m_data.accuracy;
  147. }
  148. virtual short GetAmmo(void) const
  149. {
  150. return m_data.ammo;
  151. }
  152. virtual IprojectileTypeIGC* GetProjectileType(void) const
  153. {
  154. return m_projectileType;
  155. }
  156. virtual const Vector& GetEmissionPt(void) const
  157. {
  158. return m_emissionPt;
  159. }
  160. virtual float GetRipcordDelay(void) const
  161. {
  162. return m_data.dtRipcord;
  163. }
  164. virtual SoundID GetAmbientSound(void) const
  165. {
  166. return m_data.ambientSound;
  167. }
  168. private:
  169. ImissionIGC* m_pMission;
  170. DataProbeTypeIGC m_data;
  171. Vector m_emissionPt;
  172. IprojectileTypeIGC* m_projectileType;
  173. };
  174. #endif //__PROBETYPEIGC_H_