Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
4.4 KiB

  1. #ifndef MISSION_CHOOSER_INT_H
  2. #define MISSION_CHOOSER_INT_H
  3. #ifdef _WIN32
  4. #pragma once
  5. #endif
  6. #include "appframework/IAppSystem.h"
  7. #include "utlvector.h"
  8. class IASW_Random_Missions;
  9. class IASW_Mission_Chooser_Source;
  10. class IASW_Map_Builder;
  11. class KeyValues;
  12. class CUniformRandomStream;
  13. class Color;
  14. class IASWSpawnSelection;
  15. class IASW_Location;
  16. class IASW_Location_Group
  17. {
  18. public:
  19. virtual const char* GetGroupName() = 0;
  20. virtual const char* GetTitleText() = 0;
  21. virtual const char* GetDescriptionText() = 0;
  22. virtual const char* GetImageName() = 0;
  23. virtual Color& GetColor() = 0;
  24. virtual bool IsGroupLocked( CUtlVector<int> &completedMissions ) = 0;
  25. virtual int GetHighestUnlockMissionID() = 0;
  26. virtual int GetNumLocations() = 0;
  27. virtual IASW_Location* GetLocation( int iIndex ) = 0;
  28. };
  29. enum ASW_Reward_Type
  30. {
  31. ASW_REWARD_MONEY=0,
  32. ASW_REWARD_XP,
  33. ASW_REWARD_ITEM,
  34. ASW_REWARD_SKILL_SLOT,
  35. };
  36. class IASW_Reward
  37. {
  38. public:
  39. virtual ASW_Reward_Type GetRewardType() = 0;
  40. virtual int GetRewardAmount() = 0;
  41. // for item rewards
  42. virtual const char* GetRewardName() = 0;
  43. virtual int GetRewardLevel() = 0;
  44. virtual int GetRewardQuality() = 0;
  45. };
  46. class IASW_Location
  47. {
  48. public:
  49. virtual int GetID() = 0;
  50. virtual IASW_Location_Group* GetGroup() = 0;
  51. virtual int GetDifficulty() = 0;
  52. virtual bool GetCompleted() = 0;
  53. virtual int GetXPos() = 0;
  54. virtual int GetYPos() = 0;
  55. // Mission Settings are settings not directly related to the level layout, but which have other effects on the mission.
  56. // (This is the "mission_settings" sub-node of the mission definition).
  57. virtual KeyValues* GetMissionSettings() = 0;
  58. // Mission Definition is the key-values block fed to the layout system.
  59. virtual KeyValues* GetMissionDefinition() = 0;
  60. virtual const char* GetMapName() = 0;
  61. virtual const char* GetStoryScene() = 0;
  62. virtual const char* GetImageName() = 0;
  63. virtual const char* GetCompanyName() = 0;
  64. virtual const char* GetCompanyImage() = 0;
  65. virtual int GetNumRewards() = 0;
  66. virtual IASW_Reward* GetReward( int iRewardIndex ) = 0;
  67. virtual int GetMoneyReward() = 0;
  68. virtual int GetXPReward() = 0;
  69. virtual int IsMissionOptional() = 0;
  70. virtual bool IsLocationLocked( CUtlVector<int> &completedMissions ) = 0;
  71. virtual void SetPos( int x, int y ) = 0;
  72. };
  73. class IASW_Location_Grid
  74. {
  75. public:
  76. virtual int GetNumGroups() = 0;
  77. virtual IASW_Location_Group* GetGroup( int iIndex ) = 0;
  78. virtual IASW_Location_Group* GetGroupByName( const char *szName ) = 0;
  79. virtual IASW_Location* GetLocationByID( int iLocationID ) = 0;
  80. virtual void SetLocationComplete( int iLocationID ) = 0;
  81. };
  82. class IASW_Mission_Text_Database
  83. {
  84. public:
  85. virtual const char *GetShortDescriptionByID( unsigned int id ) = 0;
  86. virtual const char *GetLongDescriptionByID( unsigned int id ) = 0;
  87. /// a unique identifier for each mission spec.
  88. /// if they're loaded from the same files in the same
  89. /// order by the database on both server and client,
  90. /// we can refer to specs by this id across the network.
  91. // if you change the size of this, also update the m_nObjectiveTextIdx
  92. // datatable field in asw_objective.cpp.
  93. typedef uint16 ID_t;
  94. enum { INVALID_INDEX = ((ID_t)(~0)) };
  95. static inline bool IsIDValid( ID_t idx ) { return idx != INVALID_INDEX; }
  96. /// find the mission text id for a given entity name, mission filename, other criteria.
  97. /// you can resolve the ID to textual descriptions with GetShortDescriptionByID() etc.
  98. virtual ID_t FindMissionTextID( const char *pEntityName, const char *pMissionName ) = 0;
  99. };
  100. //-----------------------------------------------------------------------------
  101. // Purpose: Interface exposed from the mission chooser .dll (to the game dlls and tilegen.exe)
  102. //-----------------------------------------------------------------------------
  103. abstract_class IASW_Mission_Chooser : public IAppSystem
  104. {
  105. public:
  106. virtual bool GetCurrentTimeAndDate(int *year, int *month, int *dayOfWeek, int *day, int *hour, int *minute, int *second) = 0;
  107. virtual IASW_Random_Missions *RandomMissions() = 0;
  108. virtual IASW_Mission_Chooser_Source *LocalMissionSource() = 0;
  109. virtual IASW_Location_Grid *LocationGrid() = 0;
  110. virtual IASW_Mission_Text_Database *MissionTextDatabase() = 0;
  111. virtual IASW_Map_Builder *MapBuilder() = 0;
  112. virtual IASWSpawnSelection *SpawnSelection() = 0;
  113. };
  114. #define ASW_MISSION_CHOOSER_VERSION "VASWMissionChooser001"
  115. #endif // MISSION_CHOOSER_INT_H