Data Shard Plugin
Loading...
Searching...
No Matches
Util functions

Functions for BP and C++
All functions can be found in the DataShardUtils_BP. More...

Functions

static bool DataShardUtils_BP::CreateShard (const UObject *WorldContextObject, const FDataShardKey &Key, const int32 &InitData)
 
static bool DataShardUtils_BP::SetOrCreateShard (const UObject *WorldContextObject, const FDataShardKey &Key, const int32 &InitData)
 
static bool DataShardUtils_BP::RemoveShard (const UObject *WorldContextObject, const FDataShardKey &Key)
 
static void DataShardUtils_BP::SetShardData (const UObject *WorldContextObject, const FDataShardKey &Key, const int32 &InData)
 
static bool DataShardUtils_BP::GetShardData (const UObject *WorldContextObject, const FDataShardKey &Key, int32 &OutData)
 
static bool DataShardUtils_BP::GetShardDataPure (const UObject *WorldContextObject, const FDataShardKey &Key, int32 &OutData)
 
static bool DataShardUtils_BP::CreateBoundKey (const UObject *WorldContextObject, const FDataShardKey &Parent, const FString &Name, AActor *Actor, FDataShardKey &OutKey)
 
static bool DataShardUtils_BP::IsKeyValid (const UObject *WorldContextObject, const FDataShardKey &Key)
 
static FDataShardKey DataShardUtils_BP::MakeShardKey (const FString &Name, UObject *Owner)
 
static FDataShardKey DataShardUtils_BP::MakeGlobalShardKey (const UObject *WorldContextObject, const FString &Name)
 
static void DataShardUtils_BP::BindEventOnShardDataChange (const UObject *WorldContextObject, const FDataShardKey &Key, const FOnShardDataChange &Event)
 
static void DataShardUtils_BP::UnbindEventOnShardDataChange (const UObject *WorldContextObject, const FDataShardKey &Key, const FOnShardDataChange &Event)
 
static void DataShardUtils_BP::UnbindAllEventsOnShardDataChange (const UObject *WorldContextObject, const FDataShardKey &Key)
 

Detailed Description

Functions for BP and C++
All functions can be found in the DataShardUtils_BP.

Function Documentation

◆ BindEventOnShardDataChange()

static void DataShardUtils_BP::BindEventOnShardDataChange ( const UObject * WorldContextObject,
const FDataShardKey & Key,
const FOnShardDataChange & Event )
static

Registers an event to be called when a DataShard's value changes

Parameters
WorldContextObjectObject that provides access to the world
KeyKey to the DataShard to monitor for changes
EventEvent delegate that will be triggered when the DataShard value changes

◆ CreateBoundKey()

static bool DataShardUtils_BP::CreateBoundKey ( const UObject * WorldContextObject,
const FDataShardKey & Parent,
const FString & Name,
AActor * Actor,
FDataShardKey & OutKey )
static

Creates a new key that references an existing DataShard Allows multiple keys to access the same DataShard data

Parameters
WorldContextObjectObject that provides access to the world
ParentExisting key to a DataShard
NameName for the new key
ActorActor that will own the new key (can be null for global keys)
OutKey[out] Receives the newly created key
Returns
True if the new key was successfully created, false if parent key was invalid

◆ CreateShard()

static bool DataShardUtils_BP::CreateShard ( const UObject * WorldContextObject,
const FDataShardKey & Key,
const int32 & InitData )
static

Creates a new DataShard with the specified key and data

Parameters
WorldContextObjectObject that provides access to the world
KeyKey that will be used to access the DataShard
InitDataThe initial data to store in the DataShard (can be any data type)
Returns
True if the DataShard was successfully created, false otherwise

◆ GetShardData()

static bool DataShardUtils_BP::GetShardData ( const UObject * WorldContextObject,
const FDataShardKey & Key,
int32 & OutData )
static

Retrieves data from a DataShard

Parameters
WorldContextObjectObject that provides access to the world
KeyKey to the DataShard to retrieve data from
OutData[out] Variable that will receive the DataShard's data (must be the correct type)
Returns
True if the DataShard was found and data retrieved successfully, false otherwise

◆ GetShardDataPure()

static bool DataShardUtils_BP::GetShardDataPure ( const UObject * WorldContextObject,
const FDataShardKey & Key,
int32 & OutData )
static

Retrieves data from a DataShard

Parameters
WorldContextObjectObject that provides access to the world
KeyKey to the DataShard to retrieve data from
OutData[out] Variable that will receive the DataShard's data (must be the correct type)
Returns
True if the DataShard was found and data retrieved successfully, false otherwise

◆ IsKeyValid()

static bool DataShardUtils_BP::IsKeyValid ( const UObject * WorldContextObject,
const FDataShardKey & Key )
static

Checks if a key exists in the subsystem and points to a valid shard

Parameters
WorldContextObjectObject that provides access to the world
KeyThe key to check
Returns
true if the key exists and points to a valid shard, false otherwise

◆ MakeGlobalShardKey()

static FDataShardKey DataShardUtils_BP::MakeGlobalShardKey ( const UObject * WorldContextObject,
const FString & Name )
static

Creates a global DataShard key not associated with any specific owner Global keys are accessible from anywhere

Parameters
WorldContextObjectObject that provides access to the world
NameName identifier for the key
Returns
A new global DataShardKey structure

◆ MakeShardKey()

static FDataShardKey DataShardUtils_BP::MakeShardKey ( const FString & Name,
UObject * Owner )
static

Creates a DataShard key structure associated with a specific owner

Parameters
NameName identifier for the key
OwnerObject that will own this key (typically an Actor)
Returns
A new DataShardKey structure

◆ RemoveShard()

static bool DataShardUtils_BP::RemoveShard ( const UObject * WorldContextObject,
const FDataShardKey & Key )
static

Removes a key to a DataShard, deleting the DataShard if no references remain

Parameters
WorldContextObjectObject that provides access to the world
KeyKey to the DataShard to remove
Returns
True if the key was successfully removed, false if the key or DataShard was not found

◆ SetOrCreateShard()

static bool DataShardUtils_BP::SetOrCreateShard ( const UObject * WorldContextObject,
const FDataShardKey & Key,
const int32 & InitData )
static

Creates a new DataShard with the specified key and data if no DataShard exist. If the Key points to a existing Shard the given data will be set

Parameters
WorldContextObjectObject that provides access to the world
KeyKey that will be used to access the DataShard
InitDataThe initial or new data to store in the DataShard (can be any data type)
Returns
True if the DataShard was successfully created or exist, false otherwise

◆ SetShardData()

static void DataShardUtils_BP::SetShardData ( const UObject * WorldContextObject,
const FDataShardKey & Key,
const int32 & InData )
static

Updates the data stored in an existing DataShard Can be used to change both the value and the data type of the stored data

Parameters
WorldContextObjectObject that provides access to the world
KeyKey to the DataShard to update
InDataThe new data to store in the DataShard (can be any type, even new types are allowed)

◆ UnbindAllEventsOnShardDataChange()

static void DataShardUtils_BP::UnbindAllEventsOnShardDataChange ( const UObject * WorldContextObject,
const FDataShardKey & Key )
static

Unregisters all events from being called when a DataShard's value changes

Parameters
WorldContextObjectObject that provides access to the world
KeyKey to the DataShard to stop monitoring for all events

◆ UnbindEventOnShardDataChange()

static void DataShardUtils_BP::UnbindEventOnShardDataChange ( const UObject * WorldContextObject,
const FDataShardKey & Key,
const FOnShardDataChange & Event )
static

Unregisters a specific event from being called when a DataShard's value changes

Parameters
WorldContextObjectObject that provides access to the world
KeyKey to the DataShard to stop monitoring
EventSpecific event delegate to unregister