10 #ifndef Navigation_PathEventList_H
11 #define Navigation_PathEventList_H
81 bool IsOnUpperBound()
const;
82 bool IsOnLowerBound()
const;
84 bool IsAtLastNodeOfPath()
const;
85 bool IsAtLastNodeOfAChannel()
const;
86 Path* GetPath()
const;
95 Vec2f m_checkPointDirection;
113 PathEvent m_endingEventOnPath;
134 KyUInt32 GetPathEventIntervalCount()
const;
142 const PathEvent& GetLastPathEvent()
const;
166 const NavTag* GetNavTagOfEventInterval(
KyUInt32 intervalIdx)
const;
186 KY_INLINE
bool PathEvent::IsAtLastNodeOfPath()
const {
return m_positionOnPath.IsAtLastNodeOfPath(); }
187 KY_INLINE
bool PathEvent::IsAtLastNodeOfAChannel()
const {
return m_positionOnPath.IsAtLastNodeOfAChannel(); }
189 KY_INLINE Path* PathEvent::GetPath()
const {
return m_positionOnPath.GetPath(); }
191 KY_INLINE PathEventList::PathEventList() {}
192 KY_INLINE PathEventList::~PathEventList() { Clear(); }
194 KY_INLINE
void PathEventList::Clear() { m_pathEventIntervalArray.Clear(); }
196 KY_INLINE
KyUInt32 PathEventList::GetPathEventCount()
const {
return m_pathEventIntervalArray.GetCount(); }
198 KY_INLINE
KyUInt32 PathEventList::GetPathEventIntervalCount()
const
200 if (m_pathEventIntervalArray.GetCount() != 0)
201 return m_pathEventIntervalArray.GetCount() - 1;
208 KY_LOG_ERROR_IF(eventIdx >= GetPathEventCount(), (
"Input index is not a valid event index"));
209 KY_LOG_ERROR_IF(eventIdx == 0, (
"You cannot retrieve the index of the interval before the first event. It will return unused index"));
215 KY_LOG_ERROR_IF(eventIdx >= GetPathEventCount(), (
"Input index is not a valid event index"));
216 KY_LOG_ERROR_IF(eventIdx == GetPathEventCount() - 1, (
"You cannot retrieve the index of the interval after the last event. It will return unused index"));
229 KY_INLINE
const NavTag* PathEventList::GetNavTagOfEventInterval(
KyUInt32 intervalIdx)
const
231 KY_LOG_ERROR_IF(intervalIdx >= GetPathEventIntervalCount(), (
"Input index is not a valid interval index"));
232 return m_pathEventIntervalArray[intervalIdx + 1].m_navTagOnInterval.GetNavTag();
235 KY_INLINE
KyUInt32 PathEventList::GetStartPathEventIdxOfInterval(
KyUInt32 intervalIdx)
const
237 KY_LOG_ERROR_IF(intervalIdx >= GetPathEventIntervalCount(), (
"Input index is not a valid interval index"));
240 KY_INLINE
KyUInt32 PathEventList::GetEndPathEventIdxOfInterval(
KyUInt32 intervalIdx)
const
242 KY_LOG_ERROR_IF(intervalIdx >= GetPathEventIntervalCount(), (
"Input index is not a valid interval index"));
243 return intervalIdx + 1;
246 KY_INLINE
const PathEvent& PathEventList::GetStartPathEventOfInterval(
KyUInt32 intervalIdx)
const
248 KY_DEBUG_ASSERTN(intervalIdx < GetPathEventIntervalCount(), (
"Input index is not a valid interval index"));
249 return m_pathEventIntervalArray[intervalIdx].m_endingEventOnPath;
251 KY_INLINE
const PathEvent& PathEventList::GetEndPathEventOfInterval(
KyUInt32 intervalIdx)
const
253 KY_DEBUG_ASSERTN(intervalIdx < GetPathEventIntervalCount(), (
"Input index is not a valid interval index"));
254 return m_pathEventIntervalArray[intervalIdx + 1].m_endingEventOnPath;
259 KY_DEBUG_ASSERTN(eventIdx < GetPathEventCount(), (
"Input index is not a valid event index"));
260 return m_pathEventIntervalArray[eventIdx].m_endingEventOnPath;
263 KY_INLINE PathEvent& PathEventList::GetFirstPathEvent() {
return GetPathEvent(0); }
264 KY_INLINE PathEvent& PathEventList::GetLastPathEvent() {
return GetPathEvent(GetPathEventCount() - 1); }
266 KY_INLINE
const PathEvent& PathEventList::GetPathEvent(
KyUInt32 eventIdx)
const
268 KY_DEBUG_ASSERTN(eventIdx < GetPathEventCount(), (
"Input index is not a valid event index"));
269 return m_pathEventIntervalArray[eventIdx].m_endingEventOnPath;
272 KY_INLINE
const PathEvent& PathEventList::GetFirstPathEvent()
const {
return GetPathEvent(0); }
273 KY_INLINE
const PathEvent& PathEventList::GetLastPathEvent()
const {
return GetPathEvent(GetPathEventCount() - 1); }
278 #endif // Navigation_PathEventList_H
event is not a user checkpoint
Definition: patheventlist.h:55
This class aggregates all necessary information about a position on a Path, namely: ...
Definition: positiononpath.h:33
PathEventList aggregates all PathEvents and PathEventIntervals in a PathValidityInterval.
Definition: patheventlist.h:141
PathEvent is the PathValidityInterval upper bound.
Definition: patheventlist.h:47
PathValidityInterval bound specific: bound reached start or end of the path or the max distance of va...
Definition: patheventlist.h:34
void SetCheckPointStatus(CheckPointStatus checkPointStatus)
Allows to change the user checkpoint status of the PathEvent.
Definition: patheventlist.h:206
PathEvent is the PathValidityInterval temporary upper bound.
Definition: patheventlist.h:48
bool IsACheckPoint() const
returns true if it is a check point with or without direction
Definition: patheventlist.h:208
General purpose array for movable objects that require explicit construction/destruction.
Definition: kyarray.h:118
const NavTag * GetNavTagOnIntervalAfterEvent(KyUInt32 eventIdx) const
Returns a pointer to the NavTag lying under the interval starting at the event of index eventIdx...
Definition: patheventlist.h:253
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
CheckPointStatus
Defines whether the PathEvent is a check point or not.
Definition: patheventlist.h:53
Each instance of this class uniquely identifies a single NavFloor.
Definition: navtagptr.h:26
KyUInt32 GetIntervalIdxAfterEvent(KyUInt32 eventIdx) const
Return the index of interval starting at the event of index eventIdx.
Definition: patheventlist.h:242
The PathEvent is at a transition between the NavMesh and a PathEdge going from the NavMesh to outside...
Definition: patheventlist.h:29
The PathEvent is at a transition between different NavTags.
Definition: patheventlist.h:27
const Vec2f & GetCheckPointDirection() const
relevant only if IsACheckPointWithDirection() returns true
Definition: patheventlist.h:210
PathEvent is the PathValidityInterval lower bound.
Definition: patheventlist.h:46
The PathEvent is at a transition between the NavMesh and a PathEdge going from outside to the NavMesh...
Definition: patheventlist.h:28
This class defines a two-dimensional vector whose coordinates are stored using floating-point numbers...
Definition: vec2f.h:24
KyUInt32 GetIntervalIdxBeforeEvent(KyUInt32 eventIdx) const
Return the index of interval ending at the event of index eventIdx.
Definition: patheventlist.h:235
A PathEvent is a particular PositionOnPath which feature is specified by a PathEventType.
Definition: patheventlist.h:62
This class represents an interval between two PathEvents within a PathEventList.
Definition: patheventlist.h:114
Definition: gamekitcrowddispersion.h:20
PathEventStatusInList
Defines the PathEvent status relative to its place in the PathEventList.
Definition: patheventlist.h:42
void SetCheckPointWithDirection(Vec2f direction)
Set CheckPointStatus_EventIsACheckPoint and assigned it a direction (Currently only used with Traject...
Definition: patheventlist.h:207
const NavTag * GetNavTagOnIntervalBeforeEvent(KyUInt32 eventIdx) const
Returns a pointer to the NavTag lying under interval ending at the event of index eventIdx...
Definition: patheventlist.h:249
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
The PathEvent is not yet defined.
Definition: patheventlist.h:25
static Vec2f Zero()
Returns a vector of zero size: (0,0).
Definition: vec2f.h:154
PathEvent neither lower bound nor upper bound.
Definition: patheventlist.h:45
event is a user checkpoint with no direction specified
Definition: patheventlist.h:56
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
The PathEvent is outside the NavMesh.
Definition: patheventlist.h:30
bool IsACheckPointWithDirection() const
returns true only if is a checkpoint with direction, i.e. it returns false if it is a checkpoint but ...
Definition: patheventlist.h:209
PathValidityInterval bound specific: bound hit a border or a non-traversable navTag boundary during v...
Definition: patheventlist.h:38
The PathEvent is on a NavGraph vertex.
Definition: patheventlist.h:26
PathEvent is not yet defined.
Definition: patheventlist.h:44
The class representing a path.
Definition: path.h:42
PathEventType
Defines the different kinds of PathEvent.
Definition: patheventlist.h:23