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/>.
22 #include <nel/misc/types_nl.h>
23 #include "vision_array.h"
24 #include "vision_provider.h"
25 #include "distance_prioritizer.h"
27 #include <nel/misc/hierarchical_timer.h>
31 * You can call update for a whole cycle or call each task independantly
32 * (for example, to allow multithreading).
33 * One cycle consists of the following tasks:
35 * #2. preparePairSelection()
36 * #3. calculatePriorities()
37 * #4. initDispatcherCycle()
39 * \author Olivier Cado
40 * \author Nevrax France
50 /// Main initialization
51 void init( CHistory
*h
, CClientIdLookup
*cl
)
53 VisionProvider
.init( &VisionArray
, h
, cl
);
54 Prioritizer
.init( &VisionArray
, &VisionProvider
, h
);
57 /// Perform one cycle (PropDispatcher becomes ready for getNextParcel())
60 H_TIME(ProcessVision
, processVision(););
61 H_TIME(calculatePriorities
, calculatePriorities(););
64 /// Process Vision Differences
66 { VisionProvider
.processVision(); }
68 /// Calculate the priorities corresponding to the selected pairs
69 void calculatePriorities()
70 { Prioritizer
.calculatePriorities(); }
72 /// Unit testing (TEMP)
73 void testVisionProvider();
77 /// Entities seen by the clients and the priorities of their properties
78 CVisionArray VisionArray
;
80 /// Manager of the vision (who sees who)
81 CVisionProvider VisionProvider
;
83 /// Priority calculation
84 CDistancePrioritizer Prioritizer
;
88 /// Counter for adjustHPThreshold
89 //uint32 _AHPTCounter;
94 #endif // NL_PRIO_SUB_H
96 /* End of prio_sub.h */