stationtypeigc.h 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. /*
  2. ** Copyright (C) 1996, 1997 Microsoft Corporation. All Rights Reserved.
  3. **
  4. ** File: stationTypeIGC.h
  5. **
  6. ** Author:
  7. **
  8. ** Description:
  9. ** Header for the CstationTypeIGC class. This file was initially created by
  10. ** the ATL wizard.
  11. **
  12. ** History:
  13. */
  14. // stationTypeIGC.h : Declaration of the CstationTypeIGC
  15. #ifndef __STATIONTYPEIGC_H_
  16. #define __STATIONTYPEIGC_H_
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CstationTypeIGC
  19. class CstationTypeIGC : public IstationTypeIGC
  20. {
  21. public:
  22. CstationTypeIGC(void)
  23. :
  24. m_pstSuccessor(NULL)
  25. {
  26. }
  27. ~CstationTypeIGC(void)
  28. {
  29. }
  30. /*
  31. DWORD __stdcall AddRef(void)
  32. {
  33. return IstationTypeIGC::AddRef();
  34. }
  35. DWORD __stdcall Release(void)
  36. {
  37. return IstationTypeIGC::Release();
  38. }
  39. */
  40. public:
  41. // IbaseIGC
  42. virtual HRESULT Initialize(ImissionIGC* pMission, Time now, const void* data, int dataSize);
  43. virtual void Terminate(void);
  44. virtual int Export(void* data) const;
  45. virtual ObjectType GetObjectType(void) const
  46. {
  47. return OT_stationType;
  48. }
  49. virtual ObjectID GetObjectID(void) const
  50. {
  51. return m_data.stationTypeID;
  52. }
  53. // ItypeIGC
  54. virtual const void* GetData(void) const
  55. {
  56. return &m_data;
  57. }
  58. // IbuyableIGC
  59. virtual const char* GetModelName(void) const
  60. {
  61. return m_data.modelName;
  62. }
  63. virtual const char* GetName(void) const
  64. {
  65. return m_data.name;
  66. }
  67. virtual const char* GetDescription(void) const
  68. {
  69. return m_data.description;
  70. }
  71. virtual Money GetPrice(void) const
  72. {
  73. return m_data.price;
  74. }
  75. virtual BuyableGroupID GetGroupID(void) const
  76. {
  77. return m_data.groupID;
  78. };
  79. virtual const TechTreeBitMask& GetRequiredTechs(void) const
  80. {
  81. return m_data.ttbmRequired;
  82. }
  83. virtual const TechTreeBitMask& GetEffectTechs(void) const
  84. {
  85. return m_data.ttbmEffects;
  86. }
  87. virtual DWORD GetTimeToBuild(void) const
  88. {
  89. return m_data.timeToBuild;
  90. }
  91. // IstationTypeIGC
  92. virtual float GetSignature(void) const
  93. {
  94. return m_data.signature;
  95. }
  96. virtual float GetRadius(void) const
  97. {
  98. return m_data.radius;
  99. }
  100. virtual float GetScannerRange(void) const
  101. {
  102. return m_data.scannerRange;
  103. }
  104. virtual HitPoints GetMaxArmorHitPoints(void) const
  105. {
  106. return m_data.maxArmorHitPoints;
  107. }
  108. virtual DefenseTypeID GetArmorDefenseType(void) const
  109. {
  110. return m_data.defenseTypeArmor;
  111. }
  112. virtual HitPoints GetMaxShieldHitPoints(void) const
  113. {
  114. return m_data.maxShieldHitPoints;
  115. }
  116. virtual DefenseTypeID GetShieldDefenseType(void) const
  117. {
  118. return m_data.defenseTypeShield;
  119. }
  120. virtual float GetArmorRegeneration(void) const
  121. {
  122. return m_data.armorRegeneration;
  123. }
  124. virtual float GetShieldRegeneration(void) const
  125. {
  126. return m_data.shieldRegeneration;
  127. }
  128. virtual Money GetIncome(void) const
  129. {
  130. return m_data.income;
  131. }
  132. virtual const TechTreeBitMask& GetLocalTechs(void) const
  133. {
  134. return m_data.ttbmLocal;
  135. }
  136. virtual StationAbilityBitMask GetCapabilities(void) const
  137. {
  138. return m_data.sabmCapabilities;
  139. }
  140. bool HasCapability(StationAbilityBitMask sabm) const
  141. {
  142. return (m_data.sabmCapabilities & sabm) != 0;
  143. }
  144. virtual const char* GetTextureName(void) const
  145. {
  146. return m_data.textureName;
  147. }
  148. virtual const char* GetBuilderName(void) const
  149. {
  150. return m_data.builderName;
  151. }
  152. virtual const char* GetIconName(void) const
  153. {
  154. return m_data.iconName;
  155. }
  156. virtual IstationTypeIGC* GetSuccessorStationType(const IsideIGC* pside)
  157. {
  158. //The successor can be built if:
  159. // we have one, and
  160. // the required bits are a subset of the side tech bits and the required bits for this station
  161. // (on the logic that, if we have this station, we had the tech bits at one time)
  162. if (m_pstSuccessor != NULL)
  163. {
  164. if (m_pstSuccessor->GetRequiredTechs() <= (m_data.ttbmRequired |
  165. pside->GetDevelopmentTechs()))
  166. return m_pstSuccessor->GetSuccessorStationType(pside);
  167. }
  168. return this;
  169. }
  170. virtual AsteroidAbilityBitMask GetBuildAABM(void) const
  171. {
  172. return m_data.aabmBuild;
  173. }
  174. virtual int GetLaunchSlots(void) const
  175. {
  176. return m_nLaunchSlots;
  177. }
  178. virtual const Vector& GetLaunchPosition(int slotID) const
  179. {
  180. assert (slotID >= 0);
  181. assert (slotID < m_nLaunchSlots);
  182. return m_positionLaunches[slotID];
  183. }
  184. virtual const Vector& GetLaunchDirection(int slotID) const
  185. {
  186. assert (slotID >= 0);
  187. assert (slotID < m_nLaunchSlots);
  188. return m_directionLaunches[slotID];
  189. }
  190. virtual int GetLandSlots(void) const
  191. {
  192. return m_nLandSlots;
  193. }
  194. virtual int GetCapLandSlots(void) const
  195. {
  196. return m_nCapLandSlots;
  197. }
  198. virtual int GetLandPlanes(int slotID) const
  199. {
  200. assert (slotID >= 0);
  201. assert (slotID < m_nLandSlots);
  202. return m_nLandPlanes[slotID];
  203. }
  204. virtual const Vector& GetLandPosition(int slotID, int planeID) const
  205. {
  206. assert (slotID >= 0);
  207. assert (slotID < m_nLandSlots);
  208. assert (planeID >= 0);
  209. assert (planeID <= m_nLandPlanes[slotID]);
  210. return m_positionLandPlanes[slotID][planeID];
  211. }
  212. virtual const Vector& GetLandDirection(int slotID, int planeID) const
  213. {
  214. assert (slotID >= 0);
  215. assert (slotID < m_nLandSlots);
  216. assert (planeID >= 0);
  217. assert (planeID <= m_nLandPlanes[slotID]);
  218. return m_directionLandPlanes[slotID][planeID];
  219. }
  220. virtual SoundID GetInteriorSound() const
  221. {
  222. return m_data.interiorSound;
  223. }
  224. virtual SoundID GetInteriorAlertSound() const
  225. {
  226. return m_data.interiorAlertSound;
  227. }
  228. virtual SoundID GetExteriorSound() const
  229. {
  230. return m_data.exteriorSound;
  231. }
  232. virtual SoundID GetConstructorNeedRockSound() const
  233. {
  234. return m_data.constructorNeedRockSound;
  235. }
  236. virtual SoundID GetConstructorUnderAttackSound() const
  237. {
  238. return m_data.constructorUnderAttackSound;
  239. }
  240. virtual SoundID GetConstructorDestroyedSound() const
  241. {
  242. return m_data.constructorDestroyedSound;
  243. }
  244. virtual SoundID GetCompletionSound() const
  245. {
  246. return m_data.completionSound;
  247. }
  248. virtual SoundID GetUnderAttackSound() const
  249. {
  250. return m_data.underAttackSound;
  251. }
  252. virtual SoundID GetCriticalSound() const
  253. {
  254. return m_data.criticalSound;
  255. }
  256. virtual SoundID GetDestroyedSound() const
  257. {
  258. return m_data.destroyedSound;
  259. }
  260. virtual SoundID GetCapturedSound() const
  261. {
  262. return m_data.capturedSound;
  263. }
  264. virtual SoundID GetEnemyCapturedSound() const
  265. {
  266. return m_data.enemyCapturedSound;
  267. }
  268. virtual SoundID GetEnemyDestroyedSound() const
  269. {
  270. return m_data.enemyDestroyedSound;
  271. }
  272. virtual StationClassID GetClassID() const
  273. {
  274. return m_data.classID;
  275. }
  276. virtual IdroneTypeIGC* GetConstructionDroneType(void) const
  277. {
  278. return m_pdtConstruction;
  279. }
  280. private:
  281. ImissionIGC* m_pMission;
  282. DataStationTypeIGC m_data;
  283. IdroneTypeIGC* m_pdtConstruction;
  284. IstationTypeIGC* m_pstSuccessor;
  285. int m_nLaunchSlots;
  286. Vector m_positionLaunches[c_maxLaunchSlots];
  287. Vector m_directionLaunches[c_maxLaunchSlots];
  288. int m_nLandSlots;
  289. int m_nCapLandSlots;
  290. int m_nLandPlanes[c_maxLandSlots];
  291. Vector m_positionLandPlanes[c_maxLandSlots][c_maxLandPlanes];
  292. Vector m_directionLandPlanes[c_maxLandSlots][c_maxLandPlanes];
  293. };
  294. #endif //__STATIONTYPEIGC_H_