chafftypeigc.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. ** Copyright (C) 1996, 1997 Microsoft Corporation. All Rights Reserved.
  3. **
  4. ** File: chaffTypeIGC.cpp
  5. **
  6. ** Author:
  7. **
  8. ** Description:
  9. ** Implementation of the CchaffTypeIGC class. This file was initially created by
  10. ** the ATL wizard for the core object.
  11. **
  12. ** History:
  13. */
  14. // chaffTypeIGC.cpp : Implementation of CchaffTypeIGC
  15. #include "pch.h"
  16. #include "chaffTypeIGC.h"
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CchaffTypeIGC
  19. HRESULT CchaffTypeIGC::Initialize(ImissionIGC* pMission, Time now, const void* data, int dataSize)
  20. {
  21. assert (pMission);
  22. m_pMission = pMission;
  23. HRESULT hr = S_OK;
  24. if (data && (dataSize == sizeof(DataChaffTypeIGC)))
  25. {
  26. m_data = *((DataChaffTypeIGC*)data);
  27. pMission->AddExpendableType(this);
  28. }
  29. else
  30. hr = E_INVALIDARG;
  31. return hr;
  32. }
  33. int CchaffTypeIGC::Export(void* data) const
  34. {
  35. if (data)
  36. *((DataChaffTypeIGC*)data) = m_data;
  37. return sizeof(DataChaffTypeIGC);
  38. }