This commit is contained in:
Josef 2024-05-05 09:49:41 +02:00
parent 88c864ac6a
commit c040dcae24
4 changed files with 54 additions and 1 deletions

23
RJSensor.cpp Normal file
View File

@ -0,0 +1,23 @@
/* RJSensor.cpp */
#include "RJSensor.h"
void RJSensor::_bind_methods()
{
GDVIRTUAL_BIND( getValue );
GDVIRTUAL_BIND( isActive );
GDVIRTUAL_BIND( wasActive );
GDVIRTUAL_BIND( updateValue );
}
RJSensor::RJSensor()
{
}
RJSensor::~RJSensor()
{
}

28
RJSensor.h Normal file
View File

@ -0,0 +1,28 @@
/* RJSensor.h */
#ifndef ROKOJORI_CORE__SENSOR_H
#define ROKOJORI_CORE__SENSOR_H
#include "scene/main/node.h"
class RJSensor : public Node
{
GDCLASS(RJSensor, Node);
protected:
static void _bind_methods();
public:
GDVIRTUAL0R( float, getValue );
GDVIRTUAL0R( bool, isActive );
GDVIRTUAL0R( bool, wasActive );
GDVIRTUAL1( updateValue, float );
RJSensor();
~RJSensor();
};
#endif // ROKOJORI_CORE__SENSOR_H

View File

@ -7,6 +7,7 @@
#include "./RJNetworkNode.h" #include "./RJNetworkNode.h"
#include "./RJAction.h" #include "./RJAction.h"
#include "./RJSelector.h" #include "./RJSelector.h"
#include "./RJSensor.h"
void initialize_rokojori_action_library_module( ModuleInitializationLevel p_level ) void initialize_rokojori_action_library_module( ModuleInitializationLevel p_level )
{ {
@ -18,6 +19,7 @@ void initialize_rokojori_action_library_module( ModuleInitializationLevel p_leve
ClassDB::register_class<RJNetworkNode>(); ClassDB::register_class<RJNetworkNode>();
ClassDB::register_class<RJAction>(); ClassDB::register_class<RJAction>();
ClassDB::register_class<RJSelector>(); ClassDB::register_class<RJSelector>();
ClassDB::register_class<RJSensor>();
} }
void uninitialize_rokojori_action_library_module( ModuleInitializationLevel p_level ) void uninitialize_rokojori_action_library_module( ModuleInitializationLevel p_level )