priority.h 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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/Commando/priority.h $*
  25. * *
  26. * $Author:: Steve_t $*
  27. * *
  28. * $Modtime:: 2/23/02 12:34p $*
  29. * *
  30. * $Revision:: 10 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #ifndef __PRIORITY_H__
  36. #define __PRIORITY_H__
  37. #include "networkobject.h"
  38. class SoldierGameObj;
  39. //-----------------------------------------------------------------------------
  40. //
  41. // Server computation of object priority for a given client
  42. //
  43. class cPriority
  44. {
  45. public:
  46. static float Compute_Object_Priority(int client_id, const Vector3 & client_pos, NetworkObjectClass * p_netobject, bool do_it_anyway = false, SoldierGameObj *client_soldier = NULL);
  47. static float Get_Object_Distance(const Vector3 & client_pos, NetworkObjectClass * p_netobject);
  48. static float Compute_Object_Priority_2(int client_id, const Vector3 & client_pos, NetworkObjectClass * p_netobject, bool do_it_anyway = false, SoldierGameObj *client_soldier = NULL);
  49. static float Get_Object_Distance_2(const Vector3 & client_pos, NetworkObjectClass * p_netobject);
  50. private:
  51. static float Compute_Facing_Factor(int client_id, const Vector3 & client_pos, NetworkObjectClass * p_netobject, SoldierGameObj *client_soldier = NULL);
  52. static float Compute_Type_Factor(NetworkObjectClass * p_netobject);
  53. static float Compute_Relevance_Factor(int client_id, NetworkObjectClass * p_netobject, SoldierGameObj *client_soldier = NULL);
  54. static float Compute_Facing_Factor_2(int client_id, const Vector3 & client_pos, NetworkObjectClass * p_netobject, SoldierGameObj *client_soldier = NULL);
  55. static float Compute_Type_Factor_2(NetworkObjectClass * p_netobject, float distance);
  56. static float Compute_Relevance_Factor_2(int client_id, NetworkObjectClass * p_netobject, SoldierGameObj *client_soldier = NULL);
  57. static float MaxDistance;
  58. static const float MAX_FACING_PENALTY;
  59. static const float TURRET_FACTOR;
  60. static const float VEHICLE_FACTOR;
  61. static const float SOLDIER_FACTOR;
  62. static const float SOLDIER_IN_VEHICLE_FACTOR;
  63. static const float BUILDING_FACTOR;
  64. };
  65. //-----------------------------------------------------------------------------
  66. #endif // __PRIORITY_H__