developmentigc.cpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. ** Copyright (C) 1996, 1997 Microsoft Corporation. All Rights Reserved.
  3. **
  4. ** File: developmentIGC.cpp
  5. **
  6. ** Author:
  7. **
  8. ** Description:
  9. ** Implementation of the CdevelopmentIGC class. This file was initially created by
  10. ** the ATL wizard for the core object.
  11. **
  12. ** History:
  13. */
  14. // developmentIGC.cpp : Implementation of CdevelopmentIGC
  15. #include "pch.h"
  16. #include "developmentIGC.h"
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CdevelopmentIGC
  19. HRESULT CdevelopmentIGC::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(DataDevelopmentIGC)));
  27. m_data = *((DataDevelopmentIGC*)data);
  28. pMission->AddDevelopment(this);
  29. if (m_data.developmentID == c_didTeamMoney)
  30. {
  31. m_techOnly = false; //Wining the game is not "tech only"
  32. }
  33. else
  34. {
  35. m_techOnly = true;
  36. for (int i = 0; (i < c_gaMax); i++)
  37. {
  38. if (m_data.gas.GetAttribute(i) != 1.0f)
  39. {
  40. m_techOnly = false;
  41. break;
  42. }
  43. }
  44. }
  45. return S_OK;
  46. }
  47. void CdevelopmentIGC::Terminate(void)
  48. {
  49. m_pMission->DeleteDevelopment(this);
  50. }
  51. int CdevelopmentIGC::Export(void* data) const
  52. {
  53. if (data)
  54. *((DataDevelopmentIGC*)data) = m_data;
  55. return sizeof(DataDevelopmentIGC);
  56. }