From b933b0f7fc06f82f27e776a8da58a1bd90259831 Mon Sep 17 00:00:00 2001 From: Kah Wei Date: Fri, 16 Sep 2022 13:13:38 +0800 Subject: [PATCH] Added SerializeField attribute --- SHADE_Engine/src/Scripting/SHScriptEngine.cpp | 4 +-- .../Serialisation/SerializeFieldAttribute.hxx | 35 +++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 SHADE_Managed/src/Serialisation/SerializeFieldAttribute.hxx diff --git a/SHADE_Engine/src/Scripting/SHScriptEngine.cpp b/SHADE_Engine/src/Scripting/SHScriptEngine.cpp index 47c722dd..3116d680 100644 --- a/SHADE_Engine/src/Scripting/SHScriptEngine.cpp +++ b/SHADE_Engine/src/Scripting/SHScriptEngine.cpp @@ -483,8 +483,8 @@ namespace SHADE DWORD status; while (true) { - const auto SUCCESS = GetExitCodeProcess(procInfo.hProcess, &status); - if (!SUCCESS) + const auto EXEC_SUCCESS = GetExitCodeProcess(procInfo.hProcess, &status); + if (!EXEC_SUCCESS) { auto err = GetLastError(); std::ostringstream oss; diff --git a/SHADE_Managed/src/Serialisation/SerializeFieldAttribute.hxx b/SHADE_Managed/src/Serialisation/SerializeFieldAttribute.hxx new file mode 100644 index 00000000..6036a7f5 --- /dev/null +++ b/SHADE_Managed/src/Serialisation/SerializeFieldAttribute.hxx @@ -0,0 +1,35 @@ +/************************************************************************************//*! +\file SerializeFieldAttribute.hxx +\author Tng Kah Wei, kahwei.tng, 390009620 +\par email: kahwei.tng\@digipen.edu +\date Nov 5, 2021 +\brief Contains the definition of the managed SerializeField Attribute class with + the declaration of functions for working with it. + + Note: This file is written in C++17/CLI. + +Copyright (C) 2021 DigiPen Institute of Technology. +Reproduction or disclosure of this file or its contents without the prior written consent +of DigiPen Institute of Technology is prohibited. +*//*************************************************************************************/ +#pragma once + +namespace SHADE +{ + /// + /// Simple attribute to mark that a field in a Script should be serialised. + /// + [System::AttributeUsage(AttributeTargets::Field)] + public ref class SerializeField : public System::Attribute + { + public: + /*-----------------------------------------------------------------------------*/ + /* Constructors */ + /*-----------------------------------------------------------------------------*/ + /// + /// Default Constructor + /// + SerializeField() = default; + }; +} +