Apparatus Version 1.21
ECS data-oriented workflow for Unreal Engine.
Classes | Macros | Functions
Subjective.h File Reference
#include <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 "Machine.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 SKIP_MACHINE_H
 
#define SUBJECTIVE_H_SKIPPED_MACHINE_H
 
#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. More...
 
#define END_STANDARD_NETWORKED_SUBJECTIVE_PROPERTY_BLOCK(ClassT)
 Finish the standard networked subjective properties specification. More...
 

Functions

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

Macro Definition Documentation

◆ ASSERT_NETWORKED_SUBJECTIVE_PROPERTY_BLOCK

#define ASSERT_NETWORKED_SUBJECTIVE_PROPERTY_BLOCK (   ClassT)
Value:
static constexpr size_t StandardNetworkBlockOffset = offsetof(ClassT, TraitmarkPass); \
static_assert(offsetof(FStandardSubjectiveNetworkPropertyBlock, TraitmarkPass) == \
offsetof(ClassT, TraitmarkPass) - StandardNetworkBlockOffset, \
"The traitmark pass 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:100
A block of standard properties used for networking.
Definition: Subjective.h:83

◆ 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.") \
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(TraitmarkPass); \
} \
DoGetStandardNetworkPropertyBlock() const override \
{ \
return (FStandardSubjectiveNetworkPropertyBlock*)std::addressof(TraitmarkPass); \
}

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.

◆ SKIP_MACHINE_H

#define SKIP_MACHINE_H

◆ SUBJECTIVE_H_SKIPPED_MACHINE_H

#define SUBJECTIVE_H_SKIPPED_MACHINE_H

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.