1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef NL_PRIORITIZER_H
20 #define NL_PRIORITIZER_H
22 #include "nel/misc/types_nl.h"
23 #include "game_share/entity_types.h"
25 #include "processing_spreader.h"
29 * Forward declarations
33 class CPropertyDispatcher
;
34 class CPropertyIdTranslator
;
41 * It knows how to calculate the priority of pairs <Client, Entity>.
43 * \author Olivier Cado
44 * \author Nevrax France
51 /// Type of priority strategy
52 enum TPrioStrategy
{ DistanceOnly
= 0, DistanceDelta
= 1 };
58 void init( CVisionArray
*va
,
59 CPropertyIdTranslator
* pt
, CHistory
*h
);
61 /// Calculate the priorities
62 void calculatePriorities();
64 CLFECOMMON::TCoord
getDeltaPos( TEntityIndex entityindex
, TClientId clientid
, CLFECOMMON::TCLEntityId ceid
);
66 CLFECOMMON::TCoord
getDeltaOrientation( TEntityIndex entityindex
, TClientId clientid
, CLFECOMMON::TCLEntityId ceid
);
68 /// Return the priority strategy
69 TPrioStrategy
prioStrategy() const { return _PrioStrategy
; }
71 // Set the priority strategy
72 //void setPrioStrategy( TPrioStrategy ps );
74 // Constants (obsolete)
76 static const TCoord DeltaMinThreshold;
77 static const TCoord DeltaMaxThreshold;
78 static const TCoord DistMinThreshold;
79 static const TCoord DistMaxThreshold;
81 static const CLFECOMMON::TCoord MaxDelta
;
83 CProcessingSpreader PositionSpreader
, OrientationSpreader
, DiscreetSpreader
;
87 /// Calculate the priorities of position for the current cycle
88 void calculatePriorityOfPosition();
90 /// Calculate the priorities of orientation for the current cycle
91 void calculatePriorityOfOrientation();
93 /// Calculate the priorities of discreet props for the current cycle
94 void calculatePriorityOfDiscreet();
99 CVisionArray
*_VisionArray
;
101 /// Property Id Translator
102 CPropertyIdTranslator
*_PropTranslator
;
108 TPrioStrategy _PrioStrategy
;
113 #endif // NL_PRIORITIZER_H
115 /* End of prioritizer.h */