diff --git a/Source/Engine/Tests/TestScripting.cpp b/Source/Engine/Tests/TestScripting.cpp index 1d9d53554..ae1c30a3c 100644 --- a/Source/Engine/Tests/TestScripting.cpp +++ b/Source/Engine/Tests/TestScripting.cpp @@ -7,6 +7,16 @@ #include "Engine/Scripting/ManagedCLR/MUtils.h" #include +TestNesting::TestNesting(const SpawnParams& params) + : SerializableScriptingObject(params) +{ +} + +TestNesting2::TestNesting2(const SpawnParams& params) + : SerializableScriptingObject(params) +{ +} + TestClassNative::TestClassNative(const SpawnParams& params) : ScriptingObject(params) { diff --git a/Source/Engine/Tests/TestScripting.h b/Source/Engine/Tests/TestScripting.h index 49db7d85e..5cd61cbc7 100644 --- a/Source/Engine/Tests/TestScripting.h +++ b/Source/Engine/Tests/TestScripting.h @@ -6,6 +6,59 @@ #include "Engine/Core/Math/Vector3.h" #include "Engine/Core/Collections/Array.h" #include "Engine/Scripting/ScriptingObject.h" +#include "Engine/Scripting/SerializableScriptingObject.h" + +// Test compilation with nested types. +API_CLASS() class TestNesting : public SerializableScriptingObject +{ + DECLARE_SCRIPTING_TYPE(TestNesting); + API_AUTO_SERIALIZATION(); + + // Structure + API_STRUCT() struct TestAttribute : public ISerializable + { + DECLARE_SCRIPTING_TYPE_MINIMAL(TestAttribute); + API_AUTO_SERIALIZATION(); + + // Enumeration + API_ENUM() enum TestEnum + { + E1, E2, + }; + + // Enum + API_FIELD() TestEnum Enum = E1; + }; + + // Attributes + API_FIELD() Array Attributes; + // Enum + API_FIELD() TestAttribute::TestEnum Enum = TestAttribute::E1; +}; + +// Test compilation with nested types. +API_CLASS() class TestNesting2 : public SerializableScriptingObject +{ + DECLARE_SCRIPTING_TYPE(TestNesting2); + API_AUTO_SERIALIZATION(); + + // Structure + API_STRUCT() struct TestAttribute + { + DECLARE_SCRIPTING_TYPE_MINIMAL(TestAttribute); + + // Enumeration + API_ENUM() enum TestEnum + { + E1, E2, + }; + }; + + // Attributes + API_FIELD() Array Attributes; + // Enum + API_FIELD() TestNesting::TestAttribute::TestEnum Enum = TestNesting::TestAttribute::E1; +}; // Test structure. API_STRUCT(NoDefault) struct TestStruct : public ISerializable