ZoneCodeGenerator: Add a preprocessor extracting a member chain to get the name of the asset in the template

This commit is contained in:
Jan
2019-11-21 01:44:04 +01:00
parent 5f0f73838f
commit b0780ca565
4 changed files with 62 additions and 4 deletions

View File

@ -248,8 +248,8 @@ void $LoaderClassName(context.Asset)$::Load($context.Asset.Type.FullName$** pAss
GetNameMethod(context) ::= <<
std::string $LoaderClassName(context.Asset)$::GetAssetName($context.Asset.Type.FullName$* p$context.Asset.Type.Name$)
{
$if(context.Asset.HasNameMember)$
return p$context.Asset.Type.Name$->name;
$if(context.Asset.NameChain)$
return p$context.Asset.Type.Name$->$first(context.Asset.NameChain):{member | $member.Member.Name$}$$rest(context.Asset.NameChain):{member | .$member.Member.Name$}$;
$else$
return "$context.Asset.Type.Name$";
$endif$