From 26aea1a20d5bc2e35486517e2849b02f3b5d585b Mon Sep 17 00:00:00 2001 From: Josef Date: Wed, 8 May 2024 09:17:37 +0200 Subject: [PATCH] SequenceAction/Updatable --- RJSensor.h | 6 +++--- RJSequenceAction.cpp | 23 +++++++++++++++++++++++ RJSequenceAction.h | 30 ++++++++++++++++++++++++++++++ RJUpdatable.cpp | 21 +++++++++++++++++++++ RJUpdatable.h | 28 ++++++++++++++++++++++++++++ register_types.cpp | 4 ++++ 6 files changed, 109 insertions(+), 3 deletions(-) create mode 100644 RJSequenceAction.cpp create mode 100644 RJSequenceAction.h create mode 100644 RJUpdatable.cpp create mode 100644 RJUpdatable.h diff --git a/RJSensor.h b/RJSensor.h index 8364e11..d9150fc 100644 --- a/RJSensor.h +++ b/RJSensor.h @@ -3,12 +3,12 @@ #ifndef 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: static void _bind_methods(); diff --git a/RJSequenceAction.cpp b/RJSequenceAction.cpp new file mode 100644 index 0000000..7b9b071 --- /dev/null +++ b/RJSequenceAction.cpp @@ -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() +{ + +} + diff --git a/RJSequenceAction.h b/RJSequenceAction.h new file mode 100644 index 0000000..606219f --- /dev/null +++ b/RJSequenceAction.h @@ -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 diff --git a/RJUpdatable.cpp b/RJUpdatable.cpp new file mode 100644 index 0000000..5bd86ca --- /dev/null +++ b/RJUpdatable.cpp @@ -0,0 +1,21 @@ + +/* RJUpdatable.cpp */ + +#include "RJUpdatable.h" + + +void RJUpdatable::_bind_methods() +{ + GDVIRTUAL_BIND( update ); +} + +RJUpdatable::RJUpdatable() +{ + +} + +RJUpdatable::~RJUpdatable() +{ + +} + diff --git a/RJUpdatable.h b/RJUpdatable.h new file mode 100644 index 0000000..ecac7a0 --- /dev/null +++ b/RJUpdatable.h @@ -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 diff --git a/register_types.cpp b/register_types.cpp index 5e48396..1f81461 100644 --- a/register_types.cpp +++ b/register_types.cpp @@ -8,6 +8,8 @@ #include "./RJAction.h" #include "./RJSelector.h" #include "./RJSensor.h" +#include "./RJSequenceAction.h" +#include "./RJUpdatable.h" 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(); ClassDB::register_class(); ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); } void uninitialize_rokojori_action_library_module( ModuleInitializationLevel p_level )