7 #ifndef Navigation_NavFloorAndNavGraphEdgeStatusInGrid_H
8 #define Navigation_NavFloorAndNavGraphEdgeStatusInGrid_H
16 class NavFloorAndNavGraphEdgeStatusInGrid
20 typedef StatusInGridBase::IndexedStatus CellPosToNavFloorsStatus;
25 typedef StatusInGridBase::IndexedStatus NavGraphVertexToOutGoingEdgeStatus;
26 typedef StatusInGridBase::IntermediateStatusAccessor<NavGraphVertexToOutGoingEdgeStatus> NavGraphToNavGraphVertex;
29 NavFloorAndNavGraphEdgeStatusInGrid() : m_numberOfNavGraph(0) {}
31 NavFloorAndNavGraphEdgeStatusInGrid(WorkingMemory* workingMemory, ActiveData* activeData) :
32 m_statusInGridBase(), m_numberOfNavGraph(0)
34 Init(workingMemory, activeData);
37 void Init(WorkingMemory* workingMemory, ActiveData* activeData)
39 m_statusInGridBase.Init(workingMemory, activeData->GetCellBox());
40 m_numberOfNavGraph = activeData->GetNavGraphCount();
45 void ReleaseWorkingMemoryBuffer() { m_statusInGridBase.ReleaseWorkingMemoryBuffer(); }
48 KY_INLINE CellPosToNavFloorsStatus* AllocateCellPosToNavFloorsStatus(
KyUInt32 numberOfNavCell);
49 KY_INLINE NavGraphToNavGraphVertex* AllocateNavGraphToNavGraphVertex(
KyUInt32 numberOfGraphs);
50 KY_INLINE NavGraphVertexToOutGoingEdgeStatus* AllocateNavGraphVertexToEdgeStatus(
KyUInt32 numberOfOutgoingEdges);
52 KY_INLINE CellPosToNavFloorsStatus* GetCellPosToNavFloorsStatus_Unsafe(
const CellPos& cellPos)
const;
53 KY_INLINE NavGraphToNavGraphVertex* GetNavGraphToNavGraphVertex_Unsafe(NavGraphIdxInActiveData navGraphIdxInActiveData)
const;
55 KyResult OpenNode(ActiveData& activeData,
const NavFloorRawPtr& navFloorRawPtr);
56 bool IsNodeOpen(
const NavFloorRawPtr& navFloorRawPtr)
const;
58 KyResult OpenNode(ActiveData& activeData,
const NavGraphEdgeRawPtr& navGraphEdgeRawPtr);
59 bool IsNodeOpen(
const NavGraphEdgeRawPtr& navGraphEdgeRawPtr)
const;
61 KY_INLINE
bool IsInitialized()
const {
return m_statusInGridBase.IsInitialized(); }
63 StatusInGridBase m_statusInGridBase;
67 KY_INLINE NavFloorAndNavGraphEdgeStatusInGrid::CellPosToNavFloorsStatus* NavFloorAndNavGraphEdgeStatusInGrid::AllocateCellPosToNavFloorsStatus(
KyUInt32 numberOfNavCell)
69 return (CellPosToNavFloorsStatus*)m_statusInGridBase.AllocateInBufferAndMemset(
sizeof(CellPosToNavFloorsStatus), numberOfNavCell, 0xFF);
72 KY_INLINE NavFloorAndNavGraphEdgeStatusInGrid::NavGraphToNavGraphVertex* NavFloorAndNavGraphEdgeStatusInGrid::AllocateNavGraphToNavGraphVertex(
KyUInt32 numberOfGraphs)
74 return (NavGraphToNavGraphVertex*)m_statusInGridBase.AllocateInBufferAndMemset(
sizeof(NavGraphToNavGraphVertex), numberOfGraphs, 0xFF);
77 KY_INLINE NavFloorAndNavGraphEdgeStatusInGrid::NavGraphVertexToOutGoingEdgeStatus* NavFloorAndNavGraphEdgeStatusInGrid::AllocateNavGraphVertexToEdgeStatus(
KyUInt32 numberOfOutgoingEdges)
79 return (NavGraphVertexToOutGoingEdgeStatus*)m_statusInGridBase.AllocateInBufferAndMemset(
sizeof(NavGraphVertexToOutGoingEdgeStatus), numberOfOutgoingEdges, 0xFF);
83 KY_INLINE NavFloorAndNavGraphEdgeStatusInGrid::CellPosToNavFloorsStatus*
84 NavFloorAndNavGraphEdgeStatusInGrid::GetCellPosToNavFloorsStatus_Unsafe(
const CellPos& cellPos)
const
86 CellPosToNavFloorsStatus* memoryStartForGrid = (CellPosToNavFloorsStatus*)((NavGraphToNavGraphVertex*)m_statusInGridBase.GetBuffer() + m_numberOfNavGraph);
87 return memoryStartForGrid + m_statusInGridBase.m_cellBox.GetRowMajorIndex(cellPos);
90 KY_INLINE NavFloorAndNavGraphEdgeStatusInGrid::NavGraphToNavGraphVertex*
91 NavFloorAndNavGraphEdgeStatusInGrid::GetNavGraphToNavGraphVertex_Unsafe(NavGraphIdxInActiveData navGraphIdxInActiveData)
const
93 NavGraphToNavGraphVertex* memoryStartForGraphs = (NavGraphToNavGraphVertex*)m_statusInGridBase.GetBuffer();
94 return &memoryStartForGraphs[navGraphIdxInActiveData];
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
Vec2i CellPos
A type that represents the position of a cell within a 2D grid.
Definition: navmeshtypes.h:33
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36