UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
NavAgentSelector.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "NavAgentSelector.generated.h"
6
9{
11
12 static const uint32 InitializedBit = 0x80000000;
13 static const uint32 AllAgentsMask = 0x7fffffff;
14
15#if CPP
16 union
17 {
18 struct
19 {
20#endif
21 UPROPERTY(EditAnywhere, Category = Default)
22 uint32 bSupportsAgent0 : 1;
23 UPROPERTY(EditAnywhere, Category = Default)
24 uint32 bSupportsAgent1 : 1;
25 UPROPERTY(EditAnywhere, Category = Default)
26 uint32 bSupportsAgent2 : 1;
27 UPROPERTY(EditAnywhere, Category = Default)
28 uint32 bSupportsAgent3 : 1;
29 UPROPERTY(EditAnywhere, Category = Default)
30 uint32 bSupportsAgent4 : 1;
31 UPROPERTY(EditAnywhere, Category = Default)
32 uint32 bSupportsAgent5 : 1;
33 UPROPERTY(EditAnywhere, Category = Default)
34 uint32 bSupportsAgent6 : 1;
35 UPROPERTY(EditAnywhere, Category = Default)
36 uint32 bSupportsAgent7 : 1;
37 UPROPERTY(EditAnywhere, Category = Default)
38 uint32 bSupportsAgent8 : 1;
39 UPROPERTY(EditAnywhere, Category = Default)
40 uint32 bSupportsAgent9 : 1;
41 UPROPERTY(EditAnywhere, Category = Default)
42 uint32 bSupportsAgent10 : 1;
43 UPROPERTY(EditAnywhere, Category = Default)
44 uint32 bSupportsAgent11 : 1;
45 UPROPERTY(EditAnywhere, Category = Default)
46 uint32 bSupportsAgent12 : 1;
47 UPROPERTY(EditAnywhere, Category = Default)
48 uint32 bSupportsAgent13 : 1;
49 UPROPERTY(EditAnywhere, Category = Default)
50 uint32 bSupportsAgent14 : 1;
51 UPROPERTY(EditAnywhere, Category = Default)
52 uint32 bSupportsAgent15 : 1;
53#if CPP
54 };
55 uint32 PackedBits;
56 };
57#endif
58
59 ENGINE_API explicit FNavAgentSelector(const uint32 InBits = AllAgentsMask);
60
61 inline bool Contains(int32 AgentIndex) const
62 {
63 return (AgentIndex >= 0 && AgentIndex < 16) ? !!(PackedBits & (1 << AgentIndex)) : false;
64 }
65
66 inline bool ContainsAnyAgent() const
67 {
68 return PackedBits & AllAgentsMask;
69 }
70
71
72 inline void Set(int32 AgentIndex)
73 {
74 if (AgentIndex >= 0 && AgentIndex < 16)
75 {
76 PackedBits |= (1 << AgentIndex);
77 }
78 }
79
80 inline bool IsInitialized() const
81 {
82 return (PackedBits & InitializedBit) != 0;
83 }
84
85 inline void MarkInitialized()
86 {
87 PackedBits |= InitializedBit;
88 }
89
90 inline void Empty()
91 {
92 PackedBits = 0;
93 }
94
95 bool IsSame(const FNavAgentSelector& Other) const
96 {
97 return (~InitializedBit & PackedBits) == (~InitializedBit & Other.PackedBits);
98 }
99
100 ENGINE_API bool Serialize(FArchive& Ar);
101
103 {
104 return (~InitializedBit & PackedBits);
105 }
106};
107
108template<>
117
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 UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define USTRUCT(...)
Definition ObjectMacros.h:746
EPropertyObjectReferenceType
Definition ObjectMacros.h:533
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
Definition NavAgentSelector.h:9
bool IsSame(const FNavAgentSelector &Other) const
Definition NavAgentSelector.h:95
uint32 GetAgentBits() const
Definition NavAgentSelector.h:102
bool Contains(int32 AgentIndex) const
Definition NavAgentSelector.h:61
void Set(int32 AgentIndex)
Definition NavAgentSelector.h:72
bool ContainsAnyAgent() const
Definition NavAgentSelector.h:66
void MarkInitialized()
Definition NavAgentSelector.h:85
bool IsInitialized() const
Definition NavAgentSelector.h:80
void Empty()
Definition NavAgentSelector.h:90
Definition StructOpsTypeTraits.h:11
@ WithSerializer
Definition StructOpsTypeTraits.h:23
static constexpr EPropertyObjectReferenceType WithSerializerObjectReferences
Definition StructOpsTypeTraits.h:41
Definition StructOpsTypeTraits.h:46