LogisticsMissionInfo.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. #ifndef LOGISTICSMISSIONINFO_H
  2. #define LOGISTICSMISSIONINFO_H
  3. /*************************************************************************************************\
  4. LogisticsMissionInfo.h : Interface for the LogisticsMissionInfo component.
  5. //---------------------------------------------------------------------------//
  6. // Copyright (C) Microsoft Corporation. All rights reserved. //
  7. //===========================================================================//
  8. \*************************************************************************************************/
  9. #ifndef ELIST_H
  10. #include "EList.h"
  11. #endif
  12. #include "EString.h"
  13. #define MAX_PLAYER_NAME_LENGTH 64
  14. //*************************************************************************************************
  15. class FitIniFile;
  16. /**************************************************************************************************
  17. CLASS DESCRIPTION
  18. LogisticsMissionInfo:
  19. **************************************************************************************************/
  20. class LogisticsMissionInfo
  21. {
  22. public:
  23. LogisticsMissionInfo();
  24. ~LogisticsMissionInfo();
  25. long init( FitIniFile& file ); // init campaign
  26. void save( FitIniFile& file );
  27. long load( FitIniFile& file );// init previously saved stuff
  28. long getAvailableMissions( const char** missions, int& numberOfEm );
  29. long getCurrentMissions( const char** missions, int& numberOfEm );
  30. bool getMissionAvailable( const char* missionName );
  31. bool isMissionComplete( const char* missionName );
  32. bool isSingleMission() const;
  33. long setNextMission( const char* missionName );
  34. void setMissionComplete( );
  35. long getCurrentLogisticsTuneId();
  36. long getCurrentMissionId();
  37. const EString& getCurrentPurchaseFile() const;
  38. const EString& getCurrentMission() const { return currentMissionName; }
  39. const EString& getLastMission() const { return lastMissionName; }
  40. long getCurrentDropWeight() const;
  41. const char* getCurrentVideo() const;
  42. const char* getCurrentOperationFile() const;
  43. const char* getCurrentMissionDescription() const;
  44. const char* getCurrentMissionFriendlyName() const;
  45. const char* getMissionFriendlyName( const char* missionName ) const;
  46. const char* getCurrentABLScriptName() const;
  47. int getCurrentRP() const;
  48. int getCBills() const { return CBills; }
  49. void incrementCBills(int amount) { CBills += amount; }
  50. void decrementCBills(int amount) { CBills -= amount; }
  51. const EString& getCampaignName( ) const { return campaignName; }
  52. const EString& getCampaignDisplayName() const { return campaignDisplayName; }
  53. bool campaignOver() const;
  54. const char* getCurrentBigVideo() const;
  55. const char* getFinalVideo() const;
  56. void setMultiplayer();
  57. void setPurchaseFile( const char* fileName );
  58. // long getMaxTeams() const { return maxTeams; }
  59. // long getMaxPlayers() const { return maxPlayers; }
  60. int getAdditionalPurachaseFiles( const char** list, long& maxCount );
  61. void addBonusPurchaseFile( const char* fileName ); // extra bonus
  62. bool skipLogistics();
  63. bool showChooseMission();
  64. bool skipPilotReview();
  65. bool skipSalvageScreen();
  66. bool skipPurchasing();
  67. void setSingleMission( const char* pName );
  68. bool canHaveSalavageCraft();
  69. bool canHaveRepairTruck();
  70. bool canHaveScoutCopter();
  71. bool canHaveArtilleryPiece();
  72. bool canHaveAirStrike();
  73. bool canHaveSensorStrike();
  74. bool canHaveMineLayer();
  75. bool getVideoShown();
  76. void setVideoShown();
  77. long getCurrentMissionNumber()
  78. {
  79. return currentMission;
  80. }
  81. void setCurrentMissionNumber(long cMission)
  82. {
  83. currentMission = cMission;
  84. }
  85. private:
  86. class MissionInfo
  87. {
  88. public:
  89. ~MissionInfo();
  90. EString missionDescriptiveName;
  91. EString fileName;
  92. EString description;
  93. EString purchaseFileName;
  94. EString videoName;
  95. bool mandatory;
  96. bool completePrevious;
  97. bool completed;
  98. long resourcePoints;
  99. long additionalCBills;
  100. long dropWeight;
  101. bool playLogistics;
  102. bool playSalvage;
  103. bool playPilotPromotion;
  104. bool playPurchasing;
  105. bool playMissionSelection;
  106. bool hidden;
  107. bool enableSalavageCraft;
  108. bool enableRepairTruck;
  109. bool enableScoutCopter;
  110. bool enableArtilleryPiece;
  111. bool enableAirStrike;
  112. bool enableSensorStrike;
  113. bool enableMineLayer;
  114. };
  115. typedef EList<MissionInfo*, MissionInfo*> MISSION_LIST;
  116. typedef EList< char*, char* > FILE_LIST;
  117. class MissionGroup
  118. {
  119. public:
  120. long numberToBeCompleted;
  121. EString videoFileName;
  122. EString operationFileName;
  123. EString bigVideoName;
  124. EString ablBrainName;
  125. long logisticsTuneId;
  126. MISSION_LIST infos;
  127. bool bigVideoShown;
  128. bool videoShown;
  129. };
  130. // DATA
  131. EString campaignName;
  132. EString campaignDisplayName;
  133. EString playerName;
  134. EString currentMissionName;
  135. EString finalVideoName;
  136. long currentStage;
  137. long currentMission;
  138. long lastStage;
  139. long lastMission;
  140. EString lastMissionName;
  141. MissionGroup* groups;
  142. long groupCount;
  143. long CBills;
  144. void clear();
  145. bool bMultiplayer;
  146. FILE_LIST additionalPurchaseFiles;
  147. LogisticsMissionInfo::MissionInfo* getPreviousMission();
  148. void readMissionInfo( FitIniFile& file, LogisticsMissionInfo::MissionInfo* pInfo );
  149. // HELPER FUNCTIONS
  150. };
  151. //*************************************************************************************************
  152. #endif // end of file ( LogisticsMissionInfo.h )