19 ActiveSectorType_NavMesh = 0,
20 ActiveSectorType_NavGraph = 1,
21 ActiveSectorType_AbstractGraph = 2,
25 class ActiveSectorBlob
31 BlobArray<char> m_sectorName;
32 BlobArray<char> m_sectorRelativeDir;
38 SwapEndianness(e,
self.m_guid);
39 SwapEndianness(e,
self.m_sectorName);
40 SwapEndianness(e,
self.m_sectorRelativeDir);
41 SwapEndianness(e,
self.m_activeSectorType);
44 class ActiveSectorBlobBuilder :
public BaseBlobBuilder<ActiveSectorBlob>
47 static ActiveSectorType GetActiveSectorType(
const NavData* navData)
49 if (navData->GetNavMeshElementBlobCollection().GetCount() != 0)
50 return ActiveSectorType_NavMesh;
51 else if (navData->GetNavGraphBlobCollection().GetCount() != 0)
52 return ActiveSectorType_NavGraph;
53 else if (navData->GetAbstractGraphBlobCollection().GetCount() != 0)
54 return ActiveSectorType_AbstractGraph;
55 return ActiveSectorType_Undefined;
59 ActiveSectorBlobBuilder(
const KyGuid& guid,
const String& sectorName,
const String& sectorRelativeDir, ActiveSectorType activeSectorType)
60 : m_guid(guid), m_sectorName(sectorName), m_sectorRelativeDir(sectorRelativeDir), m_activeSectorType(activeSectorType) {}
72 String m_sectorRelativeDir;
73 ActiveSectorType m_activeSectorType;
78 KY_ROOT_BLOB_CLASS(NavData, ActiveDataBlob, 0)
85 BlobArray<ActiveSectorBlob> m_activeSectors;
90 SwapEndianness(e,
self.m_databaseIndex);
91 SwapEndianness(e,
self.m_activeSectors);
94 class ActiveDataBlobBuilder :
public BaseBlobBuilder<ActiveDataBlob>
97 ActiveDataBlobBuilder(
const Database* db) : m_db(db) {}
106 KyArray<Kaim::NavData*> navDataToBuild;
107 for (
KyUInt32 i = 0; i < m_db->m_navDatas.GetCount(); ++i)
112 navDataToBuild.PushBack(navData);
116 ActiveSectorBlob* activeSectors =
BLOB_ARRAY(
m_blob->m_activeSectors, navDataToBuild.GetCount());
117 for (
KyUInt32 i = 0; i < navDataToBuild.GetCount(); ++i)
119 NavData* navData = navDataToBuild[i];
120 KY_DEBUG_ERRORN_IF(navData->GetSectorName() ==
"", (
"Error in ActiveDataBlobBuilder, we should not build ActiveDataBlob for this navData"));
122 const KyGuid* guid = navData->GetMainGuid();
126 ActiveSectorType sectorType = ActiveSectorBlobBuilder::GetActiveSectorType(navData);
127 BLOB_BUILD(activeSectors[i], ActiveSectorBlobBuilder(*guid, navData->m_sectorDescriptor.m_sectorName, navData->m_sectorDescriptor.m_generatorRelativeOutputDirectory, sectorType));
131 const Database* m_db;
137 class ActiveGuidsBlob
139 KY_ROOT_BLOB_CLASS(NavData, ActiveGuidsBlob, 0)
145 BlobArray<KyGuid> m_guids;
150 SwapEndianness(e,
self.m_guids);
153 class ActiveGuidsBlobBuilder :
public BaseBlobBuilder<ActiveGuidsBlob>
157 ActiveGuidsBlobBuilder(KyArray<KyGuid, MemStat_NavData>* activeGuids) : m_activeGuids(activeGuids) {}
161 if (m_activeGuids ==
nullptr)
167 KyArray<KyGuid, MemStat_NavData>* m_activeGuids;
#define BLOB_SET(blob, value)
Use this macro only in implementations of BaseBlobBuilder::DoBuild().
Definition: baseblobbuilder.h:130
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
#define BLOB_BUILD(blob, builder)
Use this macro only in implementations of BaseBlobBuilder::DoBuild().
Definition: baseblobbuilder.h:175
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:27
The NavData class is the object containing navigation data that will be added to one Database...
Definition: navdata.h:39
#define KyUInt8MAXVAL
KyUInt8 max value
Definition: types.h:66
ActiveSectorBlob * m_blob
The blob maintained by this builder. Only modify using the macros listed under DoBuild().
Definition: baseblobbuilder.h:113
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
static const KyGuid & GetInvalidGuid()
Returns the invalid KyGuid value.
Definition: kyguid.cpp:21
#define BLOB_ARRAY_COPY_2(blobArray, ky_array)
same as BLOB_ARRAY_COPY but uses Kaim::Array as input
Definition: baseblobbuilder.h:155
#define BLOB_STRING(str, src)
Use this macro only in implementations of BaseBlobBuilder::DoBuild().
Definition: baseblobbuilder.h:166
const String & GetSectorName() const
Returns the Name passed to Kaim::GeneratorSector.
Definition: navdata.cpp:494
#define BLOB_ARRAY(blobArray, count)
Use this macro only in implementations of BaseBlobBuilder::DoBuild().
Definition: baseblobbuilder.h:139
std::uint8_t KyUInt8
uint8_t
Definition: types.h:27
#define KyUInt32MAXVAL
KyUInt32 max value
Definition: types.h:68