diff --git a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.cpp b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.cpp index 28d4d21d..2dda0606 100644 --- a/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.cpp +++ b/src/ZoneCodeGeneratorLib/Generating/Templates/ZoneMarkTemplate.cpp @@ -96,7 +96,6 @@ namespace } PrintHeaderMarkMethodDeclaration(m_env.m_asset); LINE("") - PrintHeaderGetNameMethodDeclaration(m_env.m_asset); PrintHeaderGetAssetInfoMethodDeclaration(m_env.m_asset); LINE("") PrintHeaderConstructor(); @@ -165,7 +164,6 @@ namespace LINE("") PrintMainMarkMethod(); LINE("") - PrintGetNameMethod(); PrintGetAssetInfoMethod(); } @@ -215,11 +213,6 @@ namespace LINEF("XAssetInfo<{0}>* GetAssetInfo({0}* pAsset) const;", info->m_definition->GetFullName()) } - void PrintHeaderGetNameMethodDeclaration(const StructureInformation* info) const - { - LINEF("static std::string GetAssetName({0}* pAsset);", info->m_definition->GetFullName()) - } - void PrintHeaderConstructor() const { LINEF("{0}(Zone* zone);", MarkerClassName(m_env.m_asset)) @@ -756,47 +749,15 @@ namespace LINE("}") } - void PrintGetNameMethod() - { - LINEF("std::string {0}::GetAssetName({1}* pAsset)", MarkerClassName(m_env.m_asset), m_env.m_asset->m_definition->GetFullName()) - LINE("{") - m_intendation++; - - if (!m_env.m_asset->m_name_chain.empty()) - { - LINE_START("return pAsset") - - auto first = true; - for (auto* member : m_env.m_asset->m_name_chain) - { - if (first) - { - first = false; - LINE_MIDDLEF("->{0}", member->m_member->m_name) - } - else - { - LINE_MIDDLEF(".{0}", member->m_member->m_name) - } - } - LINE_END(";") - } - else - { - LINEF("return \"{0}\";", m_env.m_asset->m_definition->m_name) - } - - m_intendation--; - LINE("}") - } - void PrintGetAssetInfoMethod() { LINEF("XAssetInfo<{0}>* {1}::GetAssetInfo({0}* pAsset) const", m_env.m_asset->m_definition->GetFullName(), MarkerClassName(m_env.m_asset)) LINE("{") m_intendation++; - LINEF("return reinterpret_cast*>(GetAssetInfoByName(GetAssetName(pAsset)));", m_env.m_asset->m_definition->GetFullName()) + LINEF("return reinterpret_cast*>(GetAssetInfoByName(AssetNameAccessor<{1}>()(*pAsset)));", + m_env.m_asset->m_definition->GetFullName(), + m_env.m_asset->m_asset_name) m_intendation--; LINE("}")