Completed namespace support for the ScriptCanvasGrammar template

Signed-off-by: lsemp3d <58790905+lsemp3d@users.noreply.github.com>
This commit is contained in:
lsemp3d
2021-08-14 16:50:57 -07:00
parent 83f6cb813a
commit 9ecb746563
2 changed files with 21 additions and 2 deletions
@@ -77,7 +77,7 @@ public: \
{% if Class.attrib['GraphEntryPoint'] is defined %} bool IsEntryPoint() const override { return {%if Class.attrib['GraphEntryPoint'] == "True" %}true{%else%}false{%endif%}; } \
{% endif %}
public: \
friend struct ::{{ className | replace(' ','') }}Property;
friend struct {% if attribute_Namespace is not defined %}::{% endif %}{{ className | replace(' ','') }}Property;
// Helpers for easily accessing properties and slots
struct {{ className | replace(' ','') }}Property
@@ -26,6 +26,20 @@ SPDX-License-Identifier: Apache-2.0 OR MIT
#include "{{ xml.attrib['Include'] }}"
{% for Class in xml.iter('Class') %}
{% set attribute_Namespace = undefined %}
{%- if Class.attrib['Namespace'] is defined %}
{% if Class.attrib['Namespace'] != "None" %}
{% set attribute_Namespace = Class.attrib['Namespace'] %}
{% endif %}
{% endif %}
{% if attribute_Namespace is defined %}
namespace {{attribute_Namespace}}
{
{% endif %}
void {{ Class.attrib['QualifiedName'] }}::ConfigureSlots()
{
{% if Class.attrib['Base'] is defined %}
@@ -269,7 +283,12 @@ void {{ Class.attrib['QualifiedName'] }}::Reflect(AZ::ReflectContext* context)
return datumValue ? *datumValue : {{ Property.attrib['Type'] }}();
}
{% endfor %}
{% if attribute_Namespace is defined %}
}
{% endif %}
{% endfor %}
{% endfor %}