UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
BlackboardKey.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "UObject/NameTypes.h"
6
7namespace FBlackboard
8{
9 const FName KeySelf = TEXT("SelfActor");
10
11#ifdef AI_BLACKBOARD_KEY_SIZE_8
12 // this is the legacy BB key size. Add AI_BLACKBOARD_KEY_SIZE_8 to your *.target.cs to enable it.
13 using FKey = uint8;
14 inline constexpr FKey InvalidKey = FKey(-1);
15#else
16 //the default BB key size is now 16
17 struct FKey
18 {
19 constexpr FKey() = default;
21 constexpr FKey(uint16 InKey) : Key(InKey) {}
22 constexpr FKey(uint8 InKey) = delete;
23 constexpr operator int32() const { return Key; }
24 constexpr operator uint16() const { return Key; }
25 constexpr operator uint8() const = delete;
26 constexpr bool operator==(const FKey& Other) const {return Key == Other.Key;}
27 constexpr bool operator!=(const FKey& Other) const {return Key != Other.Key;}
28 private:
29 friend uint32 GetTypeHash(const FKey& Key);
30 uint16 Key = static_cast<uint16>(-1);
31 };
32
33 inline constexpr FKey InvalidKey = FKey();
34
35 inline uint32 GetTypeHash(const FKey& Key) { return ::GetTypeHash(Key.Key);}
36#endif
37}
#define TEXT(x)
Definition Platform.h:1272
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
uint8_t uint8
Definition binka_ue_file_header.h:8
uint16_t uint16
Definition binka_ue_file_header.h:7
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition NameTypes.h:617
Definition BlackboardKey.h:8
uint32 GetTypeHash(const FKey &Key)
Definition BlackboardKey.h:35
const FName KeySelf
Definition BlackboardKey.h:9
constexpr FKey InvalidKey
Definition BlackboardKey.h:33
Definition BlackboardKey.h:18
constexpr FKey(uint8 InKey)=delete
constexpr bool operator!=(const FKey &Other) const
Definition BlackboardKey.h:27
constexpr FKey()=default
FKey(int32 InKey)
Definition BlackboardKey.h:20
constexpr FKey(uint16 InKey)
Definition BlackboardKey.h:21
constexpr bool operator==(const FKey &Other) const
Definition BlackboardKey.h:26
friend uint32 GetTypeHash(const FKey &Key)
Definition BlackboardKey.h:35