42 lines
1.7 KiB
C++
42 lines
1.7 KiB
C++
|
/************************************************************************************//*!
|
||
|
\file Component.h++
|
||
|
\author Tng Kah Wei, kahwei.tng, 390009620
|
||
|
\par email: kahwei.tng\@digipen.edu
|
||
|
\date Oct 27, 2021
|
||
|
\brief Contains the definition of templated functions for the managed Component
|
||
|
classes.
|
||
|
|
||
|
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
|
||
|
|
||
|
// Primary Include
|
||
|
#include "Component.hxx"
|
||
|
// Project includes
|
||
|
#include "Utility/Convert.hxx"
|
||
|
#include "Engine/ECS.hxx"
|
||
|
|
||
|
namespace SHADE
|
||
|
{
|
||
|
/*---------------------------------------------------------------------------------*/
|
||
|
/* Constructors */
|
||
|
/*---------------------------------------------------------------------------------*/
|
||
|
template <typename NativeType>
|
||
|
Component<NativeType>::Component(Entity entity)
|
||
|
: BaseComponent { entity }
|
||
|
{}
|
||
|
|
||
|
/*---------------------------------------------------------------------------------*/
|
||
|
/* Helper Functions */
|
||
|
/*---------------------------------------------------------------------------------*/
|
||
|
template <typename NativeType>
|
||
|
typename Component<NativeType>::NativeComponent* Component<NativeType>::GetNativeComponent()
|
||
|
{
|
||
|
return ECS::GetNativeComponent<NativeType>(owner.GetEntity());
|
||
|
}
|
||
|
}
|