/************************************************************************************//*! \file GameObject.cxx \author Tng Kah Wei, kahwei.tng, 390009620 \par email: kahwei.tng\@digipen.edu \date Oct 28, 2021 \brief Contains the definition of the functions for the GameObject managed class. 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. *//*************************************************************************************/ // Precompiled Headers #include "SHpch.h" // Primary Header #include "GameObject.hxx" // External Dependencies #include "Engine/ECS_Base/System/SHEntityManager.h" // Project Headers namespace SHADE { /*---------------------------------------------------------------------------------*/ /* Static Functions */ /*---------------------------------------------------------------------------------*/ GameObject GameObject::Create() { throw gcnew System::NotImplementedException(); } void GameObject::Destroy(GameObject obj) { SHEntityManager::DestroyEntity(static_cast(obj.GetEntity())); } System::Nullable GameObject::Find(System::String ^ name) { // Search the GameObjectLibrary for an Entity with the specified name throw gcnew System::NotImplementedException(); } /*---------------------------------------------------------------------------------*/ /* Properties */ /*---------------------------------------------------------------------------------*/ System::String^ GameObject::Name::get() { throw gcnew System::NotImplementedException(); } bool GameObject::IsActiveSelf::get() { throw gcnew System::NotImplementedException(); } bool GameObject::IsActiveInHierarchy::get() { throw gcnew System::NotImplementedException(); } /*---------------------------------------------------------------------------------*/ /* GameObject Property Functions */ /*---------------------------------------------------------------------------------*/ void GameObject::SetName(System::String^ name) { throw gcnew System::NotImplementedException(); } void GameObject::SetActive(bool active) { throw gcnew System::NotImplementedException(); } /*---------------------------------------------------------------------------------*/ /* Component Functions */ /*---------------------------------------------------------------------------------*/ generic T GameObject::AddComponent() { throw gcnew System::NotImplementedException(); //return ECS::AddComponent(GetNativeEntity()); } generic T GameObject::GetComponent() { throw gcnew System::NotImplementedException(); //return ECS::GetComponent(GetNativeEntity()); } generic T GameObject::GetComponentInChildren() { throw gcnew System::NotImplementedException(); //return ECS::GetComponentInChildren(GetNativeEntity()); } generic T GameObject::EnsureComponent() { throw gcnew System::NotImplementedException(); //return ECS::EnsureComponent(GetNativeEntity()); } generic void GameObject::RemoveComponent() { throw gcnew System::NotImplementedException(); //ECS::RemoveComponent(GetNativeEntity()); } /*---------------------------------------------------------------------------------*/ /* Script Access Functions */ /*---------------------------------------------------------------------------------*/ generic T GameObject::AddScript() { throw gcnew System::NotImplementedException(); //return ScriptStore::AddScript(entity); } generic T GameObject::GetScript() { throw gcnew System::NotImplementedException(); //return ScriptStore::GetScript(entity); } generic T GameObject::GetScriptInChildren() { throw gcnew System::NotImplementedException(); //return ScriptStore::GetScriptInChildren(entity); } generic System::Collections::Generic::IEnumerable^ GameObject::GetScripts() { throw gcnew System::NotImplementedException(); //return ScriptStore::GetScripts(entity); } generic void GameObject::RemoveScript() { throw gcnew System::NotImplementedException(); //ScriptStore::RemoveScript(entity); } /*---------------------------------------------------------------------------------*/ /* Constructors */ /*---------------------------------------------------------------------------------*/ GameObject::GameObject(EntityID entity) : entity { entity } {} GameObject::GameObject(Entity entity) : entity { entity } {} /*---------------------------------------------------------------------------------*/ /* Getters */ /*---------------------------------------------------------------------------------*/ SHEntity GameObject::GetNativeEntity() { throw gcnew System::NotImplementedException(); //return Convert::ToNative(entity); } /*---------------------------------------------------------------------------------*/ /* IEquatable */ /*---------------------------------------------------------------------------------*/ bool GameObject::Equals(GameObject other) { return entity == other.entity; } /*---------------------------------------------------------------------------------*/ /* Object */ /*---------------------------------------------------------------------------------*/ bool GameObject::Equals(Object^ o) { try { GameObject^ cmp = safe_cast(o); return Equals(cmp); } catch (System::InvalidCastException^) { return false; } } int GameObject::GetHashCode() { return entity.GetHashCode(); } bool GameObject::operator==(GameObject lhs, GameObject rhs) { return lhs.Equals(rhs); } bool GameObject::operator!=(GameObject lhs, GameObject rhs) { return !(lhs == rhs); } }