LadderDefs.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. ** Command & Conquer Generals Zero Hour(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. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: LadderDefs.h //////////////////////////////////////////////////////
  24. // Generals ladder definitions
  25. // Author: Matthew D. Campbell, August 2002
  26. #pragma once
  27. #ifndef __LADDERDEFS_H__
  28. #define __LADDERDEFS_H__
  29. #include "Common/UnicodeString.h"
  30. #include "Common/AsciiString.h"
  31. #include "Common/STLTypedefs.h"
  32. class GameWindow;
  33. class LadderInfo
  34. {
  35. public:
  36. LadderInfo();
  37. UnicodeString name;
  38. UnicodeString description;
  39. UnicodeString location;
  40. Int playersPerTeam;
  41. Int minWins;
  42. Int maxWins;
  43. Bool randomMaps;
  44. Bool randomFactions;
  45. Bool validQM;
  46. Bool validCustom;
  47. std::list<AsciiString> validMaps;
  48. std::list<AsciiString> validFactions;
  49. AsciiString cryptedPassword;
  50. AsciiString address;
  51. UnsignedShort port;
  52. AsciiString homepageURL;
  53. Bool submitReplay; // with game results
  54. Int index;
  55. };
  56. typedef std::list<LadderInfo *> LadderInfoList;
  57. class LadderList
  58. {
  59. public:
  60. LadderList();
  61. ~LadderList();
  62. const LadderInfo* findLadder( const AsciiString& addr, UnsignedShort port );
  63. const LadderInfo* findLadderByIndex( Int index ); // doesn't look in local ladders
  64. const LadderInfoList* getLocalLadders( void );
  65. const LadderInfoList* getSpecialLadders( void );
  66. const LadderInfoList* getStandardLadders( void );
  67. private:
  68. void loadLocalLadders( void );
  69. void checkLadder( AsciiString fname, Int index );
  70. LadderInfoList m_localLadders;
  71. LadderInfoList m_specialLadders;
  72. LadderInfoList m_standardLadders;
  73. };
  74. extern LadderList *TheLadderList;
  75. #endif // __LADDERDEFS_H__