IAGCAsteroidImpl.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef __IAGCAsteroidImpl_h__
  2. #define __IAGCAsteroidImpl_h__
  3. /////////////////////////////////////////////////////////////////////////////
  4. // IAGCAsteroidImpl.h : Declaration of the IAGCAsteroidImpl class template.
  5. //
  6. #include "IAGCDamageImpl.h"
  7. /////////////////////////////////////////////////////////////////////////////
  8. // Interface Map Macro
  9. //
  10. // Classes derived from IAGCAsteroidImpl should include this macro in their
  11. // interface maps.
  12. //
  13. #define COM_INTERFACE_ENTRIES_IAGCAsteroidImpl() \
  14. COM_INTERFACE_ENTRY(IAGCAsteroid) \
  15. COM_INTERFACE_ENTRY(IDispatch) \
  16. COM_INTERFACE_ENTRIES_IAGCDamageImpl()
  17. /////////////////////////////////////////////////////////////////////////////
  18. // IAGCAsteroidImpl
  19. //
  20. template <class T, class IGC, class ITF, const GUID* plibid, class AGCIGC = IGC, class AGCITF = ITF>
  21. class ATL_NO_VTABLE IAGCAsteroidImpl :
  22. public IAGCDamageImpl<T, IGC, ITF, plibid, AGCIGC, AGCITF>
  23. {
  24. // Types
  25. public:
  26. typedef IAGCAsteroidImpl<T, IGC, ITF, plibid, AGCIGC, AGCITF>
  27. IAGCAsteroidImplBase;
  28. // IAGCAsteroid Interface Methods
  29. public:
  30. STDMETHODIMP get_Ore(float* pfOre)
  31. {
  32. assert(GetIGC());
  33. CLEAROUT(pfOre, GetIGC()->GetOre());
  34. return S_OK;
  35. }
  36. STDMETHODIMP get_Capabilities(AGCAsteroidAbilityBitMask* paabmCapabilities)
  37. {
  38. assert(GetIGC());
  39. CLEAROUT(paabmCapabilities,
  40. (AGCAsteroidAbilityBitMask)GetIGC()->GetCapabilities());
  41. return S_OK;
  42. }
  43. STDMETHODIMP get_HasCapability(AGCAsteroidAbilityBitMask aabm,
  44. VARIANT_BOOL* pbHasCapability)
  45. {
  46. assert(GetIGC());
  47. CLEAROUT(pbHasCapability,
  48. VARBOOL(GetIGC()->HasCapability((AsteroidAbilityBitMask)aabm)));
  49. return S_OK;
  50. }
  51. };
  52. /////////////////////////////////////////////////////////////////////////////
  53. #endif //__IAGCAsteroidImpl_h__