Open 3D Engine AzFramework 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.
AzFramework::InMemorySpawnableAssetContainer Class Reference

Classes

struct  SpawnableAssetData
 

Public Types

using Assets = AZStd::vector< AZ::Data::Asset< AZ::Data::AssetData > >
 
using CreateSpawnableResult = AZ::Outcome< AZStd::reference_wrapper< AZ::Data::Asset< AZ::Data::AssetData > >, AZStd::string >
 
using RemoveSpawnableResult = AZ::Outcome< void, AZStd::string >
 
using AssetDataInfoPair = AZStd::pair< AZ::Data::AssetData *, AZ::Data::AssetInfo >
 
using AssetDataInfoContainer = AZStd::vector< AssetDataInfoPair >
 
using SpawnableAssets = AZStd::unordered_map< AZStd::string, SpawnableAssetData >
 

Public Member Functions

 AZ_CLASS_ALLOCATOR (InMemorySpawnableAssetContainer, AZ::SystemAllocator)
 
RemoveSpawnableResult RemoveInMemorySpawnableAsset (AZStd::string_view spawnableName)
 
AZ::Data::AssetId GetInMemorySpawnableAssetId (AZStd::string_view spawnableName) const
 
bool HasInMemorySpawnableAsset (AZStd::string_view spawnableName) const
 
void ClearAllInMemorySpawnableAssets ()
 
SpawnableAssets && MoveAllInMemorySpawnableAssets ()
 
const SpawnableAssets & GetAllInMemorySpawnableAssets () const
 
CreateSpawnableResult CreateInMemorySpawnableAsset (AssetDataInfoContainer &assetDataInfoContainer, bool loadReferencedAssets, const AZStd::string &targetSpawnableName)
 
CreateSpawnableResult CreateInMemorySpawnableAsset (Spawnable *spawnable, const AZ::Data::AssetId &assetId, bool loadReferencedAssets, const AZStd::string &targetSpawnableName)
 

Member Function Documentation

◆ CreateInMemorySpawnableAsset() [1/2]

CreateSpawnableResult AzFramework::InMemorySpawnableAssetContainer::CreateInMemorySpawnableAsset ( AssetDataInfoContainer &  assetDataInfoContainer,
bool  loadReferencedAssets,
const AZStd::string &  targetSpawnableName 
)

Creates an in-memory spawnable asset given a list of product asset data

Parameters
assetDataInfoContainera list of asset data/info pairs to be converted into a spawnable asset
loadReferencedAssetsa boolean that indicates whether to load the assets referenced from the asset data
targetSpawnableNamethe name of the target spawnable whose asset should be returned upon success
Returns
an outcome containing the target spawnable asset upon success

◆ CreateInMemorySpawnableAsset() [2/2]

CreateSpawnableResult AzFramework::InMemorySpawnableAssetContainer::CreateInMemorySpawnableAsset ( Spawnable spawnable,
const AZ::Data::AssetId &  assetId,
bool  loadReferencedAssets,
const AZStd::string &  targetSpawnableName 
)

Creates an in-memory spawnable asset given a single spawnable asset data. Ex. a network server receives in-memory spawnable data from client and creates a spawnable asset

Parameters
spawnablethe spawnable asset data to be converted into a spawnable asset
assetIdthe Id of the new asset
assetSizethe size of the new asset
loadReferencedAssetsa boolean that indicates whether to load the assets referenced from the asset data
targetSpawnableNamethe name of the target spawnable whose asset should be returned upon success
Returns
an outcome containing the target spawnable asset upon success

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