Apparatus Version 1.23
ECS data-oriented workflow for Unreal Engine.
Loading...
Searching...
No Matches
Classes | Macros | Functions
Subjective.h File Reference
#include "More/type_traits"
#include "CoreMinimal.h"
#include "UObject/Interface.h"
#include "GameFramework/Actor.h"
#include "GameFramework/Pawn.h"
#include "UObject/WeakInterfacePtr.h"
#include "Detail.h"
#include "ConstSubjectHandle.h"
#include "Subjective.generated.h"
Include dependency graph for Subjective.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  FStandardSubjectivePropertyBlock
 The standard subjective property block. More...
 
struct  FStandardSubjectiveNetworkPropertyBlock
 A block of standard properties used for networking. More...
 
class  ISubjective
 An interface for all sorts of subjectives. More...
 
class  ISolidSubjective
 A solid-state version of the subjective. More...
 

Macros

#define ASSERT_SUBJECTIVE_PROPERTY_BLOCK(ClassT)
 
#define ASSERT_NETWORKED_SUBJECTIVE_PROPERTY_BLOCK(ClassT)
 
#define END_STANDARD_SUBJECTIVE_PROPERTY_BLOCK(ClassT)
 Finish the standard subjective properties specification.
 
#define END_STANDARD_NETWORKED_SUBJECTIVE_PROPERTY_BLOCK(ClassT)
 Finish the standard networked subjective properties specification.
 

Functions

uint32 GetTypeHash (const TWeakInterfacePtr< ISubjective > &Subjective)
 
template<class C >
constexpr bool IsSubjectiveClass ()
 Check if the supplied class is actually a subjective.
 

Macro Definition Documentation

◆ ASSERT_NETWORKED_SUBJECTIVE_PROPERTY_BLOCK

#define ASSERT_NETWORKED_SUBJECTIVE_PROPERTY_BLOCK (   ClassT)
Value:
static constexpr size_t StandardNetworkBlockOffset = offsetof(ClassT, TraitmarkPermit); \
static_assert(offsetof(FStandardSubjectiveNetworkPropertyBlock, TraitmarkPermit) == \
offsetof(ClassT, TraitmarkPermit) - StandardNetworkBlockOffset, \
"The traitmark permit offsets must match."); \
static_assert(offsetof(FStandardSubjectiveNetworkPropertyBlock, SubjectNetworkId) == \
offsetof(ClassT, SubjectNetworkId) - StandardNetworkBlockOffset, \
"The subject network identifier offsets must match.")
#define ASSERT_SUBJECTIVE_PROPERTY_BLOCK(ClassT)
Definition: Subjective.h:109
A block of standard properties used for networking.
Definition: Subjective.h:92

◆ ASSERT_SUBJECTIVE_PROPERTY_BLOCK

#define ASSERT_SUBJECTIVE_PROPERTY_BLOCK (   ClassT)
Value:
static constexpr size_t StandardBlockOffset = offsetof(ClassT, Traits); \
static_assert(offsetof(FStandardSubjectivePropertyBlock, Traits) == \
offsetof(ClassT, Traits) - StandardBlockOffset, \
"The traits offsets must match."); \
static_assert(offsetof(FStandardSubjectivePropertyBlock, Details) == \
offsetof(ClassT, Details) - StandardBlockOffset, \
"The details offsets must match."); \
static_assert(offsetof(FStandardSubjectivePropertyBlock, PreferredBelt) == \
offsetof(ClassT, PreferredBelt) - StandardBlockOffset, \
"The preferred belt offsets must match."); \
static_assert(offsetof(FStandardSubjectivePropertyBlock, Flagmark) == \
offsetof(ClassT, Flagmark) - StandardBlockOffset, \
"The flagmark offsets must match."); \
static_assert(offsetof(FStandardSubjectivePropertyBlock, MechanismOverride) == \
offsetof(ClassT, MechanismOverride) - StandardBlockOffset, \
"The mechanism override offsets must match.") \
The standard subjective property block.
Definition: Subjective.h:57

◆ END_STANDARD_NETWORKED_SUBJECTIVE_PROPERTY_BLOCK

#define END_STANDARD_NETWORKED_SUBJECTIVE_PROPERTY_BLOCK (   ClassT)
Value:
FORCEINLINE bool IsNetworkCapable() const override \
{ \
return true; \
} \
DoGetStandardPropertyBlock() override \
{ \
ASSERT_NETWORKED_SUBJECTIVE_PROPERTY_BLOCK(ClassT); \
return (FStandardSubjectivePropertyBlock*)std::addressof(Traits); \
} \
DoGetStandardPropertyBlock() const override \
{ \
return (FStandardSubjectivePropertyBlock*)std::addressof(Traits); \
} \
DoGetStandardNetworkPropertyBlock() override \
{ \
ASSERT_NETWORKED_SUBJECTIVE_PROPERTY_BLOCK(ClassT); \
return (FStandardSubjectiveNetworkPropertyBlock*)std::addressof(TraitmarkPermit); \
} \
DoGetStandardNetworkPropertyBlock() const override \
{ \
return (FStandardSubjectiveNetworkPropertyBlock*)std::addressof(TraitmarkPermit); \
}

Finish the standard networked subjective properties specification.

Checks the necessary data and its layout. Provides the standard properties block accessor.

Parameters
ClassTA class that actually implements the networked subjective.

◆ END_STANDARD_SUBJECTIVE_PROPERTY_BLOCK

#define END_STANDARD_SUBJECTIVE_PROPERTY_BLOCK (   ClassT)
Value:
DoGetStandardPropertyBlock() override \
{ \
ASSERT_SUBJECTIVE_PROPERTY_BLOCK(ClassT); \
return (FStandardSubjectivePropertyBlock*)std::addressof(Traits); \
} \
DoGetStandardPropertyBlock() const override \
{ \
return (FStandardSubjectivePropertyBlock*)std::addressof(Traits); \
}

Finish the standard subjective properties specification.

Checks the necessary data and its layout. Provides the standard properties block accessor.

Parameters
ClassTA class that actually implements the subjective.

Function Documentation

◆ GetTypeHash()

uint32 GetTypeHash ( const TWeakInterfacePtr< ISubjective > &  Subjective)
inline

◆ IsSubjectiveClass()

template<class C >
constexpr bool IsSubjectiveClass ( )
constexpr

Check if the supplied class is actually a subjective.

Also supports checking the solid subjectives.

Template Parameters
CThe class to examine.
Returns
The state of examination.