RankPointValue.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. ** Command & Conquer Generals(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: RankPointValue.h /////////////////////////////////////////////////
  24. //-----------------------------------------------------------------------------
  25. //
  26. // Electronic Arts Pacific.
  27. //
  28. // Confidential Information
  29. // Copyright (C) 2002 - All Rights Reserved
  30. //
  31. //-----------------------------------------------------------------------------
  32. //
  33. // created: Sep 2002
  34. //
  35. // Filename: RankPointValue.h
  36. //
  37. // author: Chris Huybregts
  38. //
  39. // purpose:
  40. //
  41. //-----------------------------------------------------------------------------
  42. ///////////////////////////////////////////////////////////////////////////////
  43. #pragma once
  44. #ifndef __RANK_POINT_VALUE_H_
  45. #define __RANK_POINT_VALUE_H_
  46. //-----------------------------------------------------------------------------
  47. // SYSTEM INCLUDES ////////////////////////////////////////////////////////////
  48. //-----------------------------------------------------------------------------
  49. //-----------------------------------------------------------------------------
  50. // USER INCLUDES //////////////////////////////////////////////////////////////
  51. //-----------------------------------------------------------------------------
  52. //-----------------------------------------------------------------------------
  53. // FORWARD REFERENCES /////////////////////////////////////////////////////////
  54. //-----------------------------------------------------------------------------
  55. class Image;
  56. class PSPlayerStats;
  57. //-----------------------------------------------------------------------------
  58. // TYPE DEFINES ///////////////////////////////////////////////////////////////
  59. //-----------------------------------------------------------------------------
  60. enum
  61. {
  62. RANK_PRIVATE = 0,
  63. RANK_CORPORAL,
  64. RANK_SERGEANT,
  65. RANK_LIEUTENANT,
  66. RANK_CAPTAIN,
  67. RANK_MAJOR,
  68. RANK_COLONEL,
  69. RANK_BRIGADIER_GENERAL,
  70. RANK_GENERAL,
  71. RANK_COMMANDER_IN_CHIEF,
  72. MAX_RANKS // keep last
  73. };
  74. struct RankPoints
  75. {
  76. RankPoints(void );
  77. Int m_ranks[MAX_RANKS];
  78. Real m_winMultiplier;
  79. Real m_lostMultiplier;
  80. Real m_hourSpentOnlineMultiplier;
  81. Real m_completedSoloCampaigns;
  82. Real m_disconnectMultiplier;
  83. };
  84. //-----------------------------------------------------------------------------
  85. // INLINING ///////////////////////////////////////////////////////////////////
  86. //-----------------------------------------------------------------------------
  87. //-----------------------------------------------------------------------------
  88. // EXTERNALS //////////////////////////////////////////////////////////////////
  89. //-----------------------------------------------------------------------------
  90. Int CalculateRank( const PSPlayerStats& stats );
  91. Int GetFavoriteSide( const PSPlayerStats& stats );
  92. const Image* LookupSmallRankImage(Int side, Int rankPoints);
  93. extern RankPoints *TheRankPointValues;
  94. #endif // __RANK_POINT_VALUE_H_