dronetypeigc.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. ** Copyright (C) 1996, 1997 Microsoft Corporation. All Rights Reserved.
  3. **
  4. ** File: droneTypeIGC.cpp
  5. **
  6. ** Author:
  7. **
  8. ** Description:
  9. ** Implementation of the CdroneTypeIGC class. This file was initially created by
  10. ** the ATL wizard for the core object.
  11. **
  12. ** History:
  13. */
  14. // droneTypeIGC.cpp : Implementation of CdroneTypeIGC
  15. #include "pch.h"
  16. #include "droneTypeIGC.h"
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CdroneTypeIGC
  19. HRESULT CdroneTypeIGC::Initialize(ImissionIGC* pMission,
  20. Time now,
  21. const void* data,
  22. int dataSize)
  23. {
  24. assert (pMission);
  25. m_pMission = pMission;
  26. ZRetailAssert (data && (dataSize == sizeof(DataDroneTypeIGC)));
  27. memcpy(&m_data, data, dataSize);
  28. m_petLaid = (m_data.etidLaid == NA)
  29. ? NULL
  30. : pMission->GetExpendableType(m_data.etidLaid);
  31. assert ((m_petLaid != NULL) == (m_data.pilotType == c_ptLayer));
  32. pMission->AddDroneType(this);
  33. return S_OK;
  34. }
  35. void CdroneTypeIGC::Terminate(void)
  36. {
  37. assert (m_pMission);
  38. m_pMission->DeleteDroneType(this);
  39. }
  40. int CdroneTypeIGC::Export(void* data) const
  41. {
  42. if (data)
  43. *((DataDroneTypeIGC*)data) = m_data;
  44. return sizeof(DataDroneTypeIGC);
  45. }