Navigation
API > API/Plugins > API/Plugins/WorldConditions
The World condition context and context data are structs that are created when we want to interact with world conditions.
When using FWorldConditionQuery, we only need to deal with context data. The data is defined in
// Create context data for our Fantastic use case. const UFantasticConditionSchema* DefaultSchema = GetDefault
if (Query.IsTrue(ConditionContextData)) { ... }
When managing separate state memory, world condition context is used to bind everything together:
FWorldConditionContext Context(*this, Definition.Preconditions, Runtime.PreconditionState, ConditionContextData); if (!Context.IsTrue()) { ... }
Note: FWorldConditionContextData and FWorldConditionContext should not be stored for longer durations.
The expected availability of the world context data is as follows:
- Activate:
- Dynamic: not available
- Persistent: must be available
- IsTrue:
- Dynamic: the passed data might change on each call
- Persistent: available, but must check if an object is still valid
- Deactivate:
- Dynamic: not available
- Persistent: might not be available
When using a delegate to invalidate the query, it is advised to store weak pointer or handle to be able to unregister the delegate even if the persistent data is not available. Container for World Condition context data for a specific schema.
| Name | FWorldConditionContextData |
| Type | struct |
| Header File | /Engine/Plugins/Runtime/WorldConditions/Source/WorldConditions/Public/WorldConditionContext.h |
| Include Path | #include "WorldConditionContext.h" |
Syntax
struct FWorldConditionContextData
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FWorldConditionContextData
(
const FWorldConditionContextData& Other |
FWorldConditionContextData should not be stored for longer durations. | WorldConditionContext.h | |
FWorldConditionContextData
(
const UWorldConditionSchema& InSchema |
WorldConditionContext.h | ||
FWorldConditionContextData
(
FWorldConditionContextData&& Other |
WorldConditionContext.h | ||
| WorldConditionContext.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
T * GetContextDataPtr
(
const FWorldConditionContextDataRef& Ref |
WorldConditionContext.h | ||
EWorldConditionContextDataType GetContextDataType
(
const FWorldConditionContextDataRef& Ref |
WorldConditionContext.h | ||
const UWorldConditionSchema * GetSchema() |
WorldConditionContext.h | ||
bool IsSchemaChildOf
(
const UWorldConditionSchema* OtherSchema |
WorldConditionContext.h | ||
bool IsValid() |
WorldConditionContext.h | ||
TEnableIfTIsDerivedFrom< T, UObject >::IsDerived, bool >::Type SetContextData
(
const FName Name, |
Sets context data Struct at location specified by Name. | WorldConditionContext.h | |
bool SetContextData
(
const FWorldConditionContextDataRef& Ref, |
Sets context data from a struct view at location specified by Ref. | WorldConditionContext.h | |
TEnableIfTIsDerivedFrom< T, UObject >::IsDerived, bool >::Type SetContextData
(
const FWorldConditionContextDataRef& Ref, |
Sets context data Struct at location specified by Ref. | WorldConditionContext.h | |
TEnableIf< TIsDerivedFrom< T, UObject >::IsDerived, bool >::Type SetContextData
(
const FWorldConditionContextDataRef& Ref, |
Sets context data Object at location specified by Ref. | WorldConditionContext.h | |
TEnableIf< TIsDerivedFrom< T, UObject >::IsDerived, bool >::Type SetContextData
(
const FName Name, |
Sets context data Object at location specified by Name. | WorldConditionContext.h | |
void SetSchema
(
const UWorldConditionSchema& InSchema |
Sets schema for the context data and initializes data views. | WorldConditionContext.h | |
T * TryGetContextDataPtr
(
const FWorldConditionContextDataRef& Ref |
WorldConditionContext.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FWorldConditionContextData & operator=
(
const FWorldConditionContextData& Other |
WorldConditionContext.h | ||
FWorldConditionContextData & operator=
(
FWorldConditionContextData&& Other |
WorldConditionContext.h |