#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. | |
Static Public Member Functions | |
static void | Reflect (ReflectContext *context) |
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.
Clear all data flags for this entity.
const DataPatch::FlagsMap & AZ::SliceComponent::DataFlagsPerEntity::GetEntityDataFlags | ( | EntityId | entityId | ) | const |
Return all data flags for this entity. Addresses are relative the entity.
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.
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.
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.
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.
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