UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
NavigationObjectRepository.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "AI/Navigation/NavigationElement.h" // required since we can't fwd declare types used as TMap keys
8#include "UObject/ObjectKey.h"
10#include "NavigationObjectRepository.generated.h"
11
14
15UE_DEPRECATED(5.5, "Use the overloaded version with FNavigationElement instead.")
17
20
25UCLASS()
27{
29
30public:
31
32 // Specifies whether OnNavigationElementAddedDelegate must be broadcast on successful registration.
34 {
35 No,
36 Yes
37 };
38
46 TSharedPtr<const FNavigationElement> AddNavigationElement(FNavigationElement&& Element, ENotifyOnSuccess NotifyOnSuccess = ENotifyOnSuccess::Yes);
47
53 void RemoveNavigationElement(FNavigationElementHandle Handle);
54
58 void ForEachNavigationElement(TFunctionRef<void(const TSharedRef<const FNavigationElement>&)>) const;
59
66
72 void UnregisterNavRelevantObject(const INavRelevantInterface& NavRelevantObject);
73
79 void UnregisterNavRelevantObject(const UObject* NavRelevantObject);
80
86 FNavigationElementHandle GetNavigationElementHandleForUObject(const UObject* NavRelevantObject) const;
87
94 TSharedPtr<const FNavigationElement> GetNavigationElementForUObject(const UObject* NavRelevantObject) const;
95
102 TSharedPtr<FNavigationElement> GetMutableNavigationElementForUObject(const UObject* NavRelevantObject) const;
103
114
120 TSharedPtr<const FNavigationElement> GetNavigationElementForHandle(FNavigationElementHandle Handle) const;
121
127 TSharedPtr<FNavigationElement> GetMutableNavigationElementForHandle(FNavigationElementHandle Handle) const;
128
134 void RegisterCustomNavLinkObject(INavLinkCustomInterface& CustomNavLinkObject);
135
141 void UnregisterCustomNavLinkObject(INavLinkCustomInterface& CustomNavLinkObject);
142
148 {
149 return CustomLinkObjects;
150 }
151
154 {
155 return NavRelevantElements.Num();
156 }
157
160 {
161 return ObjectsToHandleMap.Num();
162 }
163
166 {
167 return CustomLinkObjects.Num();
168 }
169
172
175
178
181
182protected:
183 virtual bool ShouldCreateSubsystem(UObject* Outer) const override;
184
185private:
186
188
191
194
197
200
201 //----------------------------------------------------------------------//
202 // DEPRECATED
203 //----------------------------------------------------------------------//
204public:
205
206#if WITH_EDITORONLY_DATA
208 UE_DEPRECATED(5.5, "Use OnNavigationElementAddedDelegate instead.")
209 FOnNavRelevantObjectRegistrationEvent OnNavRelevantObjectRegistered;
210
211 UE_DEPRECATED(5.5, "Use OnNavigationElementRemovedDelegate instead.")
212 FOnNavRelevantObjectRegistrationEvent OnNavRelevantObjectUnregistered;
214#endif // WITH_EDITORONLY_DATA
215};
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_DELEGATE_OneParam(DelegateName, Param1Type)
Definition DelegateCombinations.h:48
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
#define UE_MT_DECLARE_TS_RW_ACCESS_DETECTOR(AccessDetector)
Definition MTTransactionallySafeAccessDetector.h:285
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UCLASS(...)
Definition ObjectMacros.h:776
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition UnrealType.h:3087
Definition NavLinkCustomInterface.h:40
Definition NavRelevantInterface.h:49
Definition Array.h:670
Definition AssetRegistryState.h:50
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition NavigationObjectRepository.h:27
int32 GetNumRegisteredElements() const
Definition NavigationObjectRepository.h:153
FOnCustomNavLinkObjectRegistrationEvent OnCustomNavLinkObjectUnregistered
Definition NavigationObjectRepository.h:180
FOnNavigationElementRegistrationEvent OnNavigationElementAddedDelegate
Definition NavigationObjectRepository.h:171
int32 GetNumRegisteredUObjects() const
Definition NavigationObjectRepository.h:159
int32 GetNumRegisteredCustomLinks() const
Definition NavigationObjectRepository.h:165
TConstArrayView< TWeakInterfacePtr< INavLinkCustomInterface > > GetCustomLinks() const
Definition NavigationObjectRepository.h:147
ENotifyOnSuccess
Definition NavigationObjectRepository.h:34
FOnCustomNavLinkObjectRegistrationEvent OnCustomNavLinkObjectRegistered
Definition NavigationObjectRepository.h:177
FOnNavigationElementRegistrationEvent OnNavigationElementRemovedDelegate
Definition NavigationObjectRepository.h:174
Definition Object.h:95
Definition WorldSubsystem.h:16
Definition NavigationElement.h:36
Definition NavigationElement.h:94