gametype.h 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** Confidential - Westwood Studios ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Commando *
  23. * *
  24. * $Archive:: /Commando/Code/Combat/gametype.h $*
  25. * *
  26. * $Author:: Tom_s $*
  27. * *
  28. * $Modtime:: 11/09/01 3:42p $*
  29. * *
  30. * $Revision:: 1 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #ifndef GAMETYPE_H
  36. #define GAMETYPE_H
  37. //-----------------------------------------------------------------------------
  38. #define IS_MISSION cGameType::Is_Mission()
  39. #define IS_SKIRMISH cGameType::Is_Skirmish()
  40. #define IS_MULTIPLAY cGameType::Is_Multiplay()
  41. #define IS_SOLOPLAY cGameType::Is_Soloplay()
  42. enum GameTypeEnum
  43. {
  44. GAMETYPE_NONE, // Unassigned
  45. GAMETYPE_MISSION, // Traditional soloplay
  46. GAMETYPE_SKIRMISH, // C&C practice against AI's
  47. GAMETYPE_MULTIPLAY, // C&C against humans
  48. };
  49. //-----------------------------------------------------------------------------
  50. class cGameType
  51. {
  52. public:
  53. static void Set_Game_Type(GameTypeEnum game_type) {GameType = game_type;}
  54. static GameTypeEnum Get_Game_Type(void) {return GameType;}
  55. static bool Is_Mission(void) {return GameType == GAMETYPE_MISSION;}
  56. static bool Is_Skirmish(void) {return GameType == GAMETYPE_SKIRMISH;}
  57. static bool Is_Multiplay(void) {return GameType == GAMETYPE_MULTIPLAY;}
  58. static bool Is_Soloplay(void) {return GameType != GAMETYPE_MULTIPLAY;}
  59. private:
  60. static GameTypeEnum GameType;
  61. };
  62. //-----------------------------------------------------------------------------
  63. #endif // GAMETYPE_H