Toggle navigation
ivorium
iv_components
Example project
GitHub
Main Page
Modules
Classes
Files
File List
File Members
ivorium_core
Attribute
Fields
FunctorActivatorField.cpp
Go to the documentation of this file.
1
#include "
FunctorActivatorField.hpp
"
2
3
namespace
iv
4
{
5
6
FunctorActivatorField::FunctorActivatorField
(
Instance
* inst, std::function<
void
() >
const
& on_activated ) :
7
Field
<
Activator
>( inst ),
8
cm( inst, this,
"FunctorActivatorField"
),
9
_on_activated( on_activated )
10
{
11
this->
cm
.
inherits
( this->
Field< Activator >::cm
);
12
}
13
14
void
FunctorActivatorField::on_activated
( std::function<
void
() >
const
& f )
15
{
16
this->_on_activated = f;
17
}
18
19
void
FunctorActivatorField::OnChanged
(
bool
real )
20
{
21
if
( this->
Get
().CopyActivations( this->_reference ) && real && this->_on_activated )
22
this->_on_activated();
23
}
24
25
}