SequenceAction/Updatable

This commit is contained in:
Josef 2024-05-08 09:17:37 +02:00
parent c040dcae24
commit 26aea1a20d
6 changed files with 109 additions and 3 deletions

View File

@ -3,12 +3,12 @@
#ifndef ROKOJORI_CORE__SENSOR_H #ifndef ROKOJORI_CORE__SENSOR_H
#define ROKOJORI_CORE__SENSOR_H #define ROKOJORI_CORE__SENSOR_H
#include "scene/main/node.h" #include "./RJNetworkNode.h"
class RJSensor : public Node class RJSensor : public RJNetworkNode
{ {
GDCLASS(RJSensor, Node); GDCLASS(RJSensor, RJNetworkNode);
protected: protected:
static void _bind_methods(); static void _bind_methods();

23
RJSequenceAction.cpp Normal file
View File

@ -0,0 +1,23 @@
/* RJSequenceAction.cpp */
#include "RJSequenceAction.h"
void RJSequenceAction::_bind_methods()
{
GDVIRTUAL_BIND( dispatchStartEvent );
GDVIRTUAL_BIND( dispatchCancelEvent );
GDVIRTUAL_BIND( dispatchEndEvent );
}
RJSequenceAction::RJSequenceAction()
{
}
RJSequenceAction::~RJSequenceAction()
{
}

30
RJSequenceAction.h Normal file
View File

@ -0,0 +1,30 @@
/* RJSequenceAction.h */
#ifndef ROKOJORI_CORE__SEQUENCE_ACTION_H
#define ROKOJORI_CORE__SEQUENCE_ACTION_H
#include "./RJAction.h"
class RJSequenceAction : public RJAction
{
GDCLASS(RJSequenceAction, RJAction);
protected:
static void _bind_methods();
public:
GDVIRTUAL0( dispatchStartEvent );
GDVIRTUAL0( dispatchCancelEvent );
GDVIRTUAL0( dispatchEndEvent );
RJSequenceAction();
~RJSequenceAction();
};
#endif // ROKOJORI_CORE__SEQUENCE_ACTION_H

21
RJUpdatable.cpp Normal file
View File

@ -0,0 +1,21 @@
/* RJUpdatable.cpp */
#include "RJUpdatable.h"
void RJUpdatable::_bind_methods()
{
GDVIRTUAL_BIND( update );
}
RJUpdatable::RJUpdatable()
{
}
RJUpdatable::~RJUpdatable()
{
}

28
RJUpdatable.h Normal file
View File

@ -0,0 +1,28 @@
/* RJUpdatable.h */
#ifndef ROKOJORI_CORE__UPDATABLE_H
#define ROKOJORI_CORE__UPDATABLE_H
#include "./RJNetworkNode.h"
class RJUpdatable : public RJNetworkNode
{
GDCLASS(RJUpdatable, RJNetworkNode);
protected:
static void _bind_methods();
public:
GDVIRTUAL1( update, double );
RJUpdatable();
~RJUpdatable();
};
#endif // ROKOJORI_CORE__UPDATABLE_H

View File

@ -8,6 +8,8 @@
#include "./RJAction.h" #include "./RJAction.h"
#include "./RJSelector.h" #include "./RJSelector.h"
#include "./RJSensor.h" #include "./RJSensor.h"
#include "./RJSequenceAction.h"
#include "./RJUpdatable.h"
void initialize_rokojori_action_library_module( ModuleInitializationLevel p_level ) void initialize_rokojori_action_library_module( ModuleInitializationLevel p_level )
{ {
@ -20,6 +22,8 @@ void initialize_rokojori_action_library_module( ModuleInitializationLevel p_leve
ClassDB::register_class<RJAction>(); ClassDB::register_class<RJAction>();
ClassDB::register_class<RJSelector>(); ClassDB::register_class<RJSelector>();
ClassDB::register_class<RJSensor>(); ClassDB::register_class<RJSensor>();
ClassDB::register_class<RJSequenceAction>();
ClassDB::register_class<RJUpdatable>();
} }
void uninitialize_rokojori_action_library_module( ModuleInitializationLevel p_level ) void uninitialize_rokojori_action_library_module( ModuleInitializationLevel p_level )