LogisticsPilot.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. #ifndef LOGISTICSPILOT_H
  2. #define LOGISTICSPILOT_H
  3. //===========================================================================//
  4. //LogisticsPilot.h : Interface for the LogisticsPilot component. //
  5. //---------------------------------------------------------------------------//
  6. // Copyright (C) Microsoft Corporation. All rights reserved. //
  7. //===========================================================================//
  8. class FitIniFile;
  9. class MechWarrior;
  10. class ForceGroupIcon;
  11. /**************************************************************************************************
  12. CLASS DESCRIPTION
  13. LogisticsPilot:
  14. **************************************************************************************************/
  15. #include "EString.h"
  16. #include "EList.h"
  17. #include "warrior.h"
  18. #define MAX_MISSIONS 50
  19. enum Medals
  20. {
  21. CAMPAIGN_RIBBON1 = 0,
  22. CAMPAIGN_RIBBON2 = 1,
  23. CAMPAIGN_RIBBON3 = 2,
  24. CAMPAIGN_FULLRIBBON1 = 3,
  25. CAMPAIGN_FULLRIBBON2 = 4,
  26. CAMPAIGN_FULLRIBBON3 = 5,
  27. PURPLE_HEART = 6,
  28. VALOR = 7,
  29. UNCOMMON_VALOR = 8,
  30. MISSION_SPEC1 = 9,
  31. MISSION_SPEC2 = 10,
  32. MISSION_SPEC3 = 11,
  33. MISSION_SPEC4 = 12,
  34. LIAO_MEDAL = 13,
  35. DAVION_MEDAL = 14,
  36. STEINER_MEDAL = 15,
  37. MAX_MEDAL
  38. };
  39. class LogisticsPilot
  40. {
  41. public:
  42. int init( char* fileName );
  43. LogisticsPilot();
  44. ~LogisticsPilot();
  45. const EString& getName() const { return name; }
  46. const EString& getAudio() const { return audio; }
  47. const EString& getVideo() const { return video; }
  48. int getRank() const { return rank; }
  49. const EString& getIconFile() const { return iconFile; }
  50. float getGunnery() const { return gunnery; }
  51. float getPiloting() const { return piloting; }
  52. int getMechKills() const { return mechKills; }
  53. int getVehicleKills() const { return vehicleKills; }
  54. int getInfantryKills() const { return infantryKills; }
  55. int getID() const { return id; }
  56. int getFlavorTextID() const { return flavorTextID; }
  57. int getNumberMissions() const;
  58. bool getMissionPlayed (long missionNum)
  59. {
  60. if ((missionNum >= 0) && (missionNum < MAX_MISSIONS))
  61. return (missionsPlayed[missionNum] == 1);
  62. return false;
  63. }
  64. bool isUsed() const{ return bIsUsed; }
  65. void setUsed( bool bUsed ){ bIsUsed = bUsed; }
  66. int getNewGunnery() const { return newGunnery; }
  67. int getNewPiloting() const { return newPiloting; }
  68. void setDead();
  69. bool isAvailable(){ return (bAvailable&&!bDead); } // depends on purchasing file .... maybe should put dead checks and stuff
  70. void setAvailable( bool available ) { bAvailable = available; }
  71. bool isDead() const { return bDead; }
  72. bool justDied() const { return bJustDied; }
  73. void setJustDied( bool bdied){ bJustDied = bdied; }
  74. long getPhotoIndex() const { return photoIndex; }
  75. bool promotePilot();
  76. int turnAverageIntoRank( float avg);
  77. static const char* getSkillText( int skillID );
  78. const EString& getFileName(){ return fileName; }
  79. long save( FitIniFile& file, long count );
  80. long load( FitIniFile& file );
  81. long update( MechWarrior* pWarrior );
  82. int getSpecialtySkillCount() const;
  83. int getSpecialtySkills( const char** array, int& count );
  84. int getSpecialtySkills( int* array, int& count );
  85. bool *getSpecialtySkills() { return specialtySkills;}
  86. void setSpecialtySkill( int skill, bool set );
  87. const bool* getNewMedalArray() const{ return medalsLastMission;}
  88. const bool* getMedalArray() const{ return medals;}
  89. void clearIcons();
  90. unsigned long id;
  91. EList< ForceGroupIcon*, ForceGroupIcon* > killedIcons;
  92. private:
  93. EString name;
  94. EString audio;
  95. EString video;
  96. long rank;
  97. EString iconFile; // or file name?
  98. float gunnery;
  99. float piloting;
  100. long mechKills;
  101. long vehicleKills;
  102. long infantryKills;
  103. long missionsCompleted;
  104. unsigned char missionsPlayed[MAX_MISSIONS];
  105. long flavorTextID;
  106. bool bIsUsed;
  107. bool bDead;
  108. bool bAvailable;
  109. bool bJustDied;
  110. long photoIndex;
  111. float newPiloting;
  112. float newGunnery;
  113. bool specialtySkills[NUM_SPECIALTY_SKILLS];
  114. static char skillTexts[][255];
  115. EString fileName;
  116. bool medals[MAX_MEDAL];
  117. bool medalsLastMission[MAX_MEDAL];
  118. // last second hack
  119. friend class LogisticsData;
  120. };
  121. //*************************************************************************************************
  122. #endif // end of file ( LogisticsPilot.h )