sculpto
Main Page
Namespaces
Classes
Files
File List
File Members
core
components
native_script_component.h
Go to the documentation of this file.
1
/*!****************************************************************/
/*!*
2
* \file native_script_component.h
3
* \brief Application scene system object native script component class implementation module.
4
*
5
* \author Sabitov Kirill
6
* \date 03 July 2022
7
*********************************************************************/
8
9
#pragma once
10
11
namespace
scl
12
{
14
class
scene_object_behaviour;
15
17
struct
native_script_component
18
{
20
scene_object_behaviour
*
ObjectBehaviour
{};
22
bool
IsActive
{
true
};
24
std::string
Name
{};
25
26
scene_object_behaviour
*(*Instanciate)();
27
void (*
Delete
)(
native_script_component
*NativeScript);
28
29
/*!*
30
* Bind native script component (instanciate object behaviour).
31
*
32
* \param None.
33
* \return None.
34
*/
35
template
<
typename
Tbehaviour>
36
void
Bind
()
37
{
38
Name
=
typeid
(Tbehaviour).name();
39
40
Instanciate
= []() {
return
(
scene_object_behaviour
*)(
new
Tbehaviour()); };
41
Delete
= [](
native_script_component
*NativeScript) {
delete
NativeScript->ObjectBehaviour; NativeScript->ObjectBehaviour =
nullptr
; };
42
}
43
};
44
}
scl::scene_object_behaviour
Definition:
scene_object_behaviour.h:17
scl
Definition:
base.h:33
scl::native_script_component
Definition:
native_script_component.h:18
scl::native_script_component::Instanciate
scene_object_behaviour *(* Instanciate)()
Definition:
native_script_component.h:26
scl::native_script_component::ObjectBehaviour
scene_object_behaviour * ObjectBehaviour
Definition:
native_script_component.h:20
scl::native_script_component::IsActive
bool IsActive
Definition:
native_script_component.h:22
scl::native_script_component::Bind
void Bind()
Definition:
native_script_component.h:36
scl::native_script_component::Delete
void(* Delete)(native_script_component *NativeScript)
Definition:
native_script_component.h:27
scl::native_script_component::Name
std::string Name
Definition:
native_script_component.h:24
Generated by
1.9.4