Add infos into target window
[ryzomcore.git] / ryzom / server / src / frontend_service / prioritizer.h
blob0009ab92add0ac538f2e0d065344fb461b0d6d1c
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
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.
8 //
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"
24 #include "fe_types.h"
25 #include "processing_spreader.h"
29 * Forward declarations
31 class CPairSelector;
32 class CVisionArray;
33 class CPropertyDispatcher;
34 class CPropertyIdTranslator;
35 class CHistory;
36 class TPairCE;
39 /**
40 * Prioritizer.
41 * It knows how to calculate the priority of pairs <Client, Entity>.
43 * \author Olivier Cado
44 * \author Nevrax France
45 * \date 2002
47 class CPrioritizer
49 public:
51 /// Type of priority strategy
52 enum TPrioStrategy { DistanceOnly = 0, DistanceDelta = 1 };
54 /// Constructor
55 CPrioritizer();
57 /// Initialization
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;
85 protected:
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();
96 private:
98 /// Vision Array
99 CVisionArray *_VisionArray;
101 /// Property Id Translator
102 CPropertyIdTranslator *_PropTranslator;
104 /// History
105 CHistory *_History;
107 /// Strategy
108 TPrioStrategy _PrioStrategy;
113 #endif // NL_PRIORITIZER_H
115 /* End of prioritizer.h */