AGCGameParameters.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. #ifndef __AGCGameParameters_h__
  2. #define __AGCGameParameters_h__
  3. /*-------------------------------------------------------------------------
  4. * fedsrv\AGCAGCGameParameters.h
  5. *
  6. * Implementation of CAGCGameParameters
  7. *
  8. *
  9. * Owner:
  10. *
  11. * Copyright 1986-1999 Microsoft Corporation, All Rights Reserved
  12. *-----------------------------------------------------------------------*/
  13. #include <AGC.h>
  14. #include "resource.h"
  15. #include "GameParamData.h"
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CAGCGameParameters
  18. class ATL_NO_VTABLE CAGCGameParameters :
  19. public IDispatchImpl<IAGCGameParameters, &IID_IAGCGameParameters, &LIBID_AGCLib>,
  20. public ISupportErrorInfo,
  21. public IPersistStreamInit,
  22. public IAGCPrivate,
  23. public AGCObjectSafetyImpl<CAGCGameParameters>,
  24. public CComCoClass<CAGCGameParameters, &CLSID_AGCGameParameters>,
  25. public CComObjectRootEx<CComMultiThreadModel>
  26. {
  27. // Declarations
  28. public:
  29. DECLARE_REGISTRY_RESOURCEID(IDR_AGCGameParameters)
  30. DECLARE_PROTECT_FINAL_CONSTRUCT()
  31. DECLARE_GET_CONTROLLING_UNKNOWN()
  32. // Interface Map
  33. public:
  34. BEGIN_COM_MAP(CAGCGameParameters)
  35. COM_INTERFACE_ENTRY(IAGCGameParameters)
  36. COM_INTERFACE_ENTRY(IDispatch)
  37. COM_INTERFACE_ENTRY(IAGCPrivate)
  38. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  39. COM_INTERFACE_ENTRY(IPersist)
  40. COM_INTERFACE_ENTRY(IPersistStreamInit)
  41. COM_INTERFACE_ENTRY2(IPersistStream, IPersistStreamInit)
  42. COM_INTERFACE_ENTRY_AUTOAGGREGATE(IID_IMarshal, m_punkMBV.p, CLSID_TCMarshalByValue)
  43. COM_INTERFACE_ENTRY(IObjectSafety)
  44. END_COM_MAP()
  45. // Category Map
  46. public:
  47. BEGIN_CATEGORY_MAP(CAGCGameParameters)
  48. IMPLEMENTED_CATEGORY(CATID_AGC)
  49. IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
  50. IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
  51. END_CATEGORY_MAP()
  52. // Construction / Destruction
  53. public:
  54. CAGCGameParameters();
  55. ~CAGCGameParameters();
  56. void Init(CGameParamData* pMissionParams)
  57. {
  58. m_mp = *pMissionParams;
  59. }
  60. // IAGCPrivate Interface Methods
  61. public:
  62. STDMETHODIMP_(void*) GetIGCVoid()
  63. {
  64. return &m_mp;
  65. }
  66. // IPersist Interface Methods
  67. public:
  68. STDMETHODIMP GetClassID(CLSID* pClassID);
  69. // IPersistStreamInit Interface Methods
  70. public:
  71. STDMETHODIMP IsDirty();
  72. STDMETHODIMP Load(IStream* pStm);
  73. STDMETHODIMP Save(IStream* pStm, BOOL fClearDirty);
  74. STDMETHODIMP GetSizeMax(ULARGE_INTEGER* pCbSize);
  75. STDMETHODIMP InitNew(void);
  76. // ISupportsErrorInfo Interface Methods
  77. public:
  78. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  79. // IAGCGameParameters Interface Methods
  80. public:
  81. STDMETHODIMP Validate();
  82. STDMETHODIMP put_MinPlayers(BYTE pVal);
  83. STDMETHODIMP get_MinPlayers(BYTE *pVal);
  84. STDMETHODIMP put_MaxPlayers(BYTE pVal);
  85. STDMETHODIMP get_MaxPlayers(BYTE *pVal);
  86. STDMETHODIMP get_NeutralSectorSpecialAsteroids(short* pVal);
  87. STDMETHODIMP put_NeutralSectorSpecialAsteroids(short pVal);
  88. STDMETHODIMP get_PlayerSectorSpecialAsteroids(short* pVal);
  89. STDMETHODIMP put_PlayerSectorSpecialAsteroids(short pVal);
  90. STDMETHODIMP get_NeutralSectorMineableAsteroids(short* pVal);
  91. STDMETHODIMP put_NeutralSectorMineableAsteroids(short pVal);
  92. STDMETHODIMP get_PlayerSectorMineableAsteroids(short* pVal);
  93. STDMETHODIMP put_PlayerSectorMineableAsteroids(short pVal);
  94. STDMETHODIMP get_NeutralSectorTreasureRate(FLOAT* pVal);
  95. STDMETHODIMP put_NeutralSectorTreasureRate(FLOAT pVal);
  96. STDMETHODIMP get_PlayerSectorTreasureRate(FLOAT* pVal);
  97. STDMETHODIMP put_PlayerSectorTreasureRate(FLOAT pVal);
  98. STDMETHODIMP get_NeutralSectorTreasures(short* pVal);
  99. STDMETHODIMP put_NeutralSectorTreasures(short pVal);
  100. STDMETHODIMP get_PlayerSectorTreasures(short* pVal);
  101. STDMETHODIMP put_PlayerSectorTreasures(short pVal);
  102. STDMETHODIMP get_NeutralSectorAsteroids(short* pVal);
  103. STDMETHODIMP put_NeutralSectorAsteroids(short pVal);
  104. STDMETHODIMP get_PlayerSectorAsteroids(short* pVal);
  105. STDMETHODIMP put_PlayerSectorAsteroids(short pVal);
  106. STDMETHODIMP get_MaxRank(short* pVal);
  107. STDMETHODIMP put_MaxRank(short pVal);
  108. STDMETHODIMP get_MinRank(short* pVal);
  109. STDMETHODIMP put_MinRank(short pVal);
  110. STDMETHODIMP get_Teams(short* pVal);
  111. STDMETHODIMP put_Teams(short pVal);
  112. STDMETHODIMP get_AlephPositioning(short* pVal);
  113. STDMETHODIMP put_AlephPositioning(short pVal);
  114. STDMETHODIMP get_AlephsPerSector(short* pVal);
  115. STDMETHODIMP put_AlephsPerSector(short pVal);
  116. STDMETHODIMP get_NeutralSectors(VARIANT_BOOL* pVal);
  117. STDMETHODIMP put_NeutralSectors(VARIANT_BOOL pVal);
  118. STDMETHODIMP get_RandomEncounters(short* pVal);
  119. STDMETHODIMP put_RandomEncounters(short pVal);
  120. STDMETHODIMP get_MapSize(short* pVal);
  121. STDMETHODIMP put_MapSize(short pVal);
  122. STDMETHODIMP get_MapType(short* pVal);
  123. STDMETHODIMP put_MapType(short pVal);
  124. STDMETHODIMP get_GoalTeamKills(short* pVal);
  125. STDMETHODIMP put_GoalTeamKills(short pVal);
  126. STDMETHODIMP get_Lives(short* pVal);
  127. STDMETHODIMP put_Lives(short pVal);
  128. STDMETHODIMP get_StartingMoney(float* pVal);
  129. STDMETHODIMP put_StartingMoney(float pVal);
  130. STDMETHODIMP get_TsiNeutralRegenerate(short* pVal);
  131. STDMETHODIMP put_TsiNeutralRegenerate(short pVal);
  132. STDMETHODIMP get_TsiPlayerRegenerate(short* pVal);
  133. STDMETHODIMP put_TsiPlayerRegenerate(short pVal);
  134. STDMETHODIMP get_TsiNeutralStart(short* pVal);
  135. STDMETHODIMP put_TsiNeutralStart(short pVal);
  136. STDMETHODIMP get_TsiPlayerStart(short* pVal);
  137. STDMETHODIMP put_TsiPlayerStart(short pVal);
  138. STDMETHODIMP get_GoalTeamMoney(AGCMoney* pVal);
  139. STDMETHODIMP put_GoalTeamMoney(AGCMoney pVal);
  140. STDMETHODIMP get_CivIDs(short element, short* pVal);
  141. STDMETHODIMP put_CivIDs(short element, short pVal);
  142. STDMETHODIMP get_ShowHomeSector(VARIANT_BOOL* pVal);
  143. STDMETHODIMP put_ShowHomeSector(VARIANT_BOOL pVal);
  144. STDMETHODIMP get_NoTeams(VARIANT_BOOL* pVal);
  145. STDMETHODIMP put_NoTeams(VARIANT_BOOL pVal);
  146. STDMETHODIMP get_RandomWormholes(VARIANT_BOOL* pVal);
  147. STDMETHODIMP put_RandomWormholes(VARIANT_BOOL pVal);
  148. STDMETHODIMP get_ResourceAmountsVisible(VARIANT_BOOL* pVal);
  149. STDMETHODIMP put_ResourceAmountsVisible(VARIANT_BOOL pVal);
  150. STDMETHODIMP get_Resources(VARIANT_BOOL* pVal);
  151. STDMETHODIMP put_Resources(VARIANT_BOOL pVal);
  152. STDMETHODIMP get_IsGoalTeamKills(VARIANT_BOOL* pVal);
  153. STDMETHODIMP put_IsGoalTeamKills(VARIANT_BOOL pVal);
  154. STDMETHODIMP get_IsGoalTeamMoney(VARIANT_BOOL* pVal);
  155. STDMETHODIMP put_IsGoalTeamMoney(VARIANT_BOOL pVal);
  156. STDMETHODIMP get_IsGoalArtifacts(VARIANT_BOOL* pVal);
  157. STDMETHODIMP put_IsGoalArtifacts(VARIANT_BOOL pVal);
  158. STDMETHODIMP get_IsGoalConquest(VARIANT_BOOL* pVal);
  159. STDMETHODIMP put_IsGoalConquest(VARIANT_BOOL pVal);
  160. STDMETHODIMP get_Drones(VARIANT_BOOL* pVal);
  161. STDMETHODIMP put_Drones(VARIANT_BOOL pVal);
  162. STDMETHODIMP get_ScoresCount(VARIANT_BOOL* pVal);
  163. STDMETHODIMP put_ScoresCount(VARIANT_BOOL pVal);
  164. STDMETHODIMP get_Stations(VARIANT_BOOL* pVal);
  165. STDMETHODIMP put_Stations(VARIANT_BOOL pVal);
  166. STDMETHODIMP get_AllowJoiners(VARIANT_BOOL* pVal);
  167. STDMETHODIMP put_AllowJoiners(VARIANT_BOOL pVal);
  168. STDMETHODIMP get_PowerUps(VARIANT_BOOL* pVal);
  169. STDMETHODIMP put_PowerUps(VARIANT_BOOL pVal);
  170. STDMETHODIMP get_AllowPrivateTeams(VARIANT_BOOL* pVal);
  171. STDMETHODIMP put_AllowPrivateTeams(VARIANT_BOOL pVal);
  172. STDMETHODIMP get_EjectPods(VARIANT_BOOL* pVal);
  173. STDMETHODIMP put_EjectPods(VARIANT_BOOL pVal);
  174. STDMETHODIMP get_GameName(BSTR* pVal);
  175. STDMETHODIMP put_GameName(BSTR pVal);
  176. STDMETHODIMP get_IGCStaticFile(BSTR *pVal);
  177. STDMETHODIMP put_IGCStaticFile(BSTR newVal);
  178. STDMETHODIMP get_GamePassword(BSTR *pVal);
  179. STDMETHODIMP put_GamePassword(BSTR newVal);
  180. STDMETHODIMP get_InvulnerableStations(VARIANT_BOOL *pVal);
  181. STDMETHODIMP put_InvulnerableStations(VARIANT_BOOL newVal);
  182. STDMETHODIMP get_ShowMap(VARIANT_BOOL *pVal);
  183. STDMETHODIMP put_ShowMap(VARIANT_BOOL newVal);
  184. STDMETHODIMP get_AllowDevelopments(VARIANT_BOOL *pVal);
  185. STDMETHODIMP put_AllowDevelopments(VARIANT_BOOL newVal);
  186. STDMETHODIMP get_AllowDefections(VARIANT_BOOL *pVal);
  187. STDMETHODIMP put_AllowDefections(VARIANT_BOOL newVal);
  188. STDMETHODIMP get_SquadGame(VARIANT_BOOL *pVal);
  189. STDMETHODIMP put_SquadGame(VARIANT_BOOL newVal);
  190. STDMETHODIMP get_AllowFriendlyFire(VARIANT_BOOL *pVal);
  191. STDMETHODIMP put_AllowFriendlyFire(VARIANT_BOOL newVal);
  192. STDMETHODIMP get_IGCcoreVersion(long *pVal);
  193. STDMETHODIMP get_GameLength(float *pVal);
  194. STDMETHODIMP put_GameLength(float newVal);
  195. STDMETHODIMP get_He3Density(float *pVal);
  196. STDMETHODIMP put_He3Density(float newVal);
  197. STDMETHODIMP get_KillPenalty(AGCMoney *pVal);
  198. STDMETHODIMP put_KillPenalty(AGCMoney newVal);
  199. STDMETHODIMP get_KillReward(AGCMoney *pVal);
  200. STDMETHODIMP put_KillReward(AGCMoney newVal);
  201. STDMETHODIMP get_EjectPenalty(AGCMoney *pVal);
  202. STDMETHODIMP put_EjectPenalty(AGCMoney newVal);
  203. STDMETHODIMP get_EjectReward(AGCMoney *pVal);
  204. STDMETHODIMP put_EjectReward(AGCMoney newVal);
  205. STDMETHODIMP get_TimeStart(double *pVal);
  206. STDMETHODIMP get_TimeStartClock(long *pVal);
  207. STDMETHODIMP get_GoalArtifactsCount(short *pVal);
  208. STDMETHODIMP put_GoalArtifactsCount(short newVal);
  209. STDMETHODIMP get_AutoRestart(VARIANT_BOOL *pVal);
  210. STDMETHODIMP put_AutoRestart(VARIANT_BOOL newVal);
  211. STDMETHODIMP get_DefaultCountdown(float *pVal);
  212. STDMETHODIMP put_DefaultCountdown(float newVal);
  213. STDMETHODIMP get_InitialMinersPerTeam(unsigned char *pVal);
  214. STDMETHODIMP put_InitialMinersPerTeam(unsigned char newVal);
  215. STDMETHODIMP get_MaxMinersPerTeam(unsigned char *pVal);
  216. STDMETHODIMP put_MaxMinersPerTeam(unsigned char newVal);
  217. STDMETHODIMP get_CustomMap(BSTR* pVal);
  218. STDMETHODIMP put_CustomMap(BSTR pVal);
  219. STDMETHODIMP get_RestartCountdown(float *pVal);
  220. STDMETHODIMP put_RestartCountdown(float newVal);
  221. STDMETHODIMP get_TotalMaxPlayers(short* pVal);
  222. STDMETHODIMP put_TotalMaxPlayers(short newVal);
  223. STDMETHODIMP get_LockTeamSettings(VARIANT_BOOL* pVal);
  224. STDMETHODIMP put_LockTeamSettings(VARIANT_BOOL newVal);
  225. STDMETHODIMP get_InvitationListID(int* pVal);
  226. STDMETHODIMP put_InvitationListID(int newVal);
  227. STDMETHODIMP get_IsSquadGame(VARIANT_BOOL* pVal);
  228. STDMETHODIMP put_IsSquadGame(VARIANT_BOOL newVal);
  229. STDMETHODIMP get_LockGameOpen(VARIANT_BOOL* pVal);
  230. STDMETHODIMP put_LockGameOpen(VARIANT_BOOL newVal);
  231. STDMETHODIMP get_TeamName(short iTeam, BSTR* pVal);
  232. STDMETHODIMP put_TeamName(short iTeam, BSTR pVal);
  233. STDMETHODIMP get_IsTechBitOverridden(short iTeam, short iBitID, VARIANT_BOOL* pVal);
  234. STDMETHODIMP get_OverriddenTechBit(short iTeam, short iBitID, VARIANT_BOOL* pVal);
  235. STDMETHODIMP put_OverriddenTechBit(short iTeam, short iBitID, VARIANT_BOOL newVal);
  236. STDMETHODIMP put_SetOverriddenTechBitRange(short iTeam, short iBitID_First, short iBitID_Last, VARIANT_BOOL newVal);
  237. STDMETHODIMP get_IsGoalFlags(VARIANT_BOOL* pVal);
  238. STDMETHODIMP put_IsGoalFlags(VARIANT_BOOL newVal);
  239. STDMETHODIMP get_GoalFlagsCount(short* pVal);
  240. STDMETHODIMP put_GoalFlagsCount(short pVal);
  241. STDMETHODIMP get_StoryText(BSTR* pbstrStory);
  242. STDMETHODIMP put_StoryText(BSTR bstrStory);
  243. STDMETHODIMP get_AllowEmptyTeams(VARIANT_BOOL* pVal);
  244. STDMETHODIMP put_AllowEmptyTeams(VARIANT_BOOL pVal);
  245. STDMETHODIMP get_AutoStart(VARIANT_BOOL *pVal);
  246. STDMETHODIMP put_AutoStart(VARIANT_BOOL newVal);
  247. STDMETHODIMP get_AllowRestart(VARIANT_BOOL *pVal);
  248. STDMETHODIMP put_AllowRestart(VARIANT_BOOL newVal);
  249. STDMETHODIMP get_AllowShipyardPath(VARIANT_BOOL* pVal);
  250. STDMETHODIMP put_AllowShipyardPath(VARIANT_BOOL pVal);
  251. STDMETHODIMP get_AllowSupremacyPath(VARIANT_BOOL* pVal);
  252. STDMETHODIMP put_AllowSupremacyPath(VARIANT_BOOL pVal);
  253. STDMETHODIMP get_AllowTacticalPath(VARIANT_BOOL* pVal);
  254. STDMETHODIMP put_AllowTacticalPath(VARIANT_BOOL pVal);
  255. STDMETHODIMP get_AllowExpansionPath(VARIANT_BOOL* pVal);
  256. STDMETHODIMP put_AllowExpansionPath(VARIANT_BOOL pVal);
  257. STDMETHODIMP get_MaxImbalance(short* pVal);
  258. STDMETHODIMP put_MaxImbalance(short Val);
  259. // Types
  260. protected:
  261. typedef TCObjectLock<CAGCGameParameters> XLock;
  262. // Data Members
  263. public:
  264. CComPtr<IUnknown> m_punkMBV; // for custom marshalling
  265. // Enumerations
  266. protected:
  267. // Indicates that the version is specified in the stream
  268. enum {c_cHasVersion = -1};
  269. // Increment this if stream format changes
  270. enum {c_cCurrentVersion = 0};
  271. // Data Members
  272. protected:
  273. CGameParamData m_mp;
  274. DATE m_timestart;
  275. CComBSTR m_bstrStoryText;
  276. };
  277. /////////////////////////////////////////////////////////////////////////////
  278. #endif //__AGCGameParameters_h__