Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::SliceComponent::DataFlagsPerEntity Class Reference

#include <SliceComponent.h>

Public Types

using DataFlagsTransformFunction = AZStd::function< DataPatch::Flags(DataPatch::Flags)>
 
using IsValidEntityFunction = AZStd::function< bool(EntityId)>
 Function used to check whether a given entity ID is allowed.
 

Public Member Functions

 AZ_CLASS_ALLOCATOR (DataFlagsPerEntity, AZ::SystemAllocator)
 
 AZ_TYPE_INFO (DataFlagsPerEntity, "{57FE7B9E-B2AF-4F6F-9F8D-87F671E91C99}")
 
 DataFlagsPerEntity (const IsValidEntityFunction &isValidEntityFunction=nullptr)
 
void SetIsValidEntityFunction (const IsValidEntityFunction &isValidEntityFunction)
 
void CopyDataFlagsFrom (const DataFlagsPerEntity &rhs)
 Replace all data flags.
 
void CopyDataFlagsFrom (DataFlagsPerEntity &&rhs)
 
void ImportDataFlagsFrom (const DataFlagsPerEntity &from, const EntityIdToEntityIdMap *remapFromIdToId=nullptr, const DataFlagsTransformFunction &dataFlagsTransformFn=nullptr)
 
DataPatch::FlagsMap GetDataFlagsForPatching (const EntityIdToEntityIdMap *remapFromIdToId=nullptr) const
 Return all entities' data flags, using addresses that align with those in a data patch.
 
void RemapEntityIds (const EntityIdToEntityIdMap &remapFromIdToId)
 
const DataPatch::FlagsMapGetEntityDataFlags (EntityId entityId) const
 
bool SetEntityDataFlags (EntityId entityId, const DataPatch::FlagsMap &dataFlags)
 
void SetEntityDataFlagsForUndo (EntityId entityId, const DataPatch::FlagsMap &dataFlags)
 
bool ClearEntityDataFlags (EntityId entityId)
 
DataPatch::Flags GetEntityDataFlagsAtAddress (EntityId entityId, const DataPatch::AddressType &dataAddress) const
 Get the data flags set at a particular address within this entity.
 
bool SetEntityDataFlagsAtAddress (EntityId entityId, const DataPatch::AddressType &dataAddress, DataPatch::Flags flags)
 
bool IsValidEntity (EntityId entityId) const
 
void Cleanup (const EntityList &validEntities)
 Discard any entries for entities or addresses that no longer exist.
 

Static Public Member Functions

static void Reflect (ReflectContext *context)
 

Detailed Description

For each entity, flags which may affect slice data inheritance.

For example, if an entity has a component field flagged with ForceOverride, that field never inherits the value from its the corresponding entity in the reference slice.

Data flags affect how inheritance works, but the flags themselves are not inherited. Data flags live at a particular level in an entity's slice ancestry. For this reason, data flags are not stored within an entity or its components (all of which are inherited by slice instances).

See DataPatch::Flags, DataPatch::Flag, DataPatch::FlagsMap for more.

Care is taken to prune this datastructure so that no empty entries are stored.

Member Function Documentation

◆ ClearEntityDataFlags()

bool AZ::SliceComponent::DataFlagsPerEntity::ClearEntityDataFlags ( EntityId  entityId)

Clear all data flags for this entity.

Returns
True if flags are cleared. False if IsValidEntity fails.

◆ GetEntityDataFlags()

const DataPatch::FlagsMap & AZ::SliceComponent::DataFlagsPerEntity::GetEntityDataFlags ( EntityId  entityId) const

Return all data flags for this entity. Addresses are relative the entity.

◆ ImportDataFlagsFrom()

void AZ::SliceComponent::DataFlagsPerEntity::ImportDataFlagsFrom ( const DataFlagsPerEntity from,
const EntityIdToEntityIdMap remapFromIdToId = nullptr,
const DataFlagsTransformFunction dataFlagsTransformFn = nullptr 
)

Add data flags. @from add data flags from this object @remapFromIdToId (optional) If provided, when importing data flags, remap which EntityId receives the flags. If an EntityId is not found in the map then its flags are not imported. If no map is provided then all data flags are imported and EntityIds are not remapped. @dataFlagsTransformFn (optional) If function is provided, then it will be applied to all imported flags.

◆ IsValidEntity()

bool AZ::SliceComponent::DataFlagsPerEntity::IsValidEntity ( EntityId  entityId) const
Returns
True if entityId passes the IsValidEntityFunction. Always returns true if no IsValidEntityFunction is set.

◆ RemapEntityIds()

void AZ::SliceComponent::DataFlagsPerEntity::RemapEntityIds ( const EntityIdToEntityIdMap remapFromIdToId)

Change all EntityIds. If an existing EntityId is not found in the map then its data is removed.

◆ SetEntityDataFlags()

bool AZ::SliceComponent::DataFlagsPerEntity::SetEntityDataFlags ( EntityId  entityId,
const DataPatch::FlagsMap dataFlags 
)

Set all data flags for this entity. Addresses should be relative to the entity.

Returns
True if flags are set. False if IsValidEntity fails.

◆ SetEntityDataFlagsAtAddress()

bool AZ::SliceComponent::DataFlagsPerEntity::SetEntityDataFlagsAtAddress ( EntityId  entityId,
const DataPatch::AddressType &  dataAddress,
DataPatch::Flags  flags 
)

Set the data flags at a particular address within this entity.

Returns
True if flags are set. False if IsValidEntity fails.

◆ SetEntityDataFlagsForUndo()

void AZ::SliceComponent::DataFlagsPerEntity::SetEntityDataFlagsForUndo ( EntityId  entityId,
const DataPatch::FlagsMap dataFlags 
)

Set all data flags for this entity. Addresses should be relative to the entity. Should only be used during the Undo process Does not check IsValidEntity, as an entity is never valid during the undo process, only after @entityId the Id of the entity you wish to perform an undo action on @dataFlags the data flags you wish to map to the given entity Id


The documentation for this class was generated from the following file: