cleanup c++ code

This commit is contained in:
2022-08-26 19:27:57 -04:00
parent 8321c8a610
commit 0f4e77d4b7
19 changed files with 340 additions and 351 deletions

View File

@@ -1,24 +1,22 @@
#include <Godot.hpp>
#include "state_machine/StateMachine.h"
#include "state_machine/State.h"
#include "Main.h"
#include "CameraLimit.h"
#include "Main.h"
#include "state_machine/State.h"
#include "state_machine/StateMachine.h"
#include "player/Player.h"
#include "player/states/PlayerIdle.h"
#include "player/states/PlayerMove.h"
#include "player/states/PlayerJump.h"
#include "player/states/PlayerFall.h"
using namespace godot;
/**
* @brief This function connects the gdnative init function.
*
*/
extern "C" void GDN_EXPORT godot_gdnative_init(godot_gdnative_init_options *o)
{
Godot::gdnative_init(o);
godot::Godot::gdnative_init(o);
}
/**
@@ -29,8 +27,8 @@ extern "C" void GDN_EXPORT godot_gdnative_terminate(godot_gdnative_terminate_opt
{
// This next line is a workaround to fix bug:
// https://github.com/godotengine/godot/issues/48295
Godot::nativescript_terminate(_RegisterState::nativescript_handle);
Godot::gdnative_terminate(o);
godot::Godot::nativescript_terminate(godot::_RegisterState::nativescript_handle);
godot::Godot::gdnative_terminate(o);
}
/**
@@ -39,14 +37,15 @@ extern "C" void GDN_EXPORT godot_gdnative_terminate(godot_gdnative_terminate_opt
*/
extern "C" void GDN_EXPORT godot_nativescript_init(void *handle)
{
Godot::nativescript_init(handle);
register_class<StateMachine>();
register_class<State>();
register_class<main::Main>();
register_class<CameraLimit>();
register_class<player::Player>();
register_class<player::PlayerIdle>();
register_class<player::PlayerMove>();
register_class<player::PlayerJump>();
register_class<player::PlayerFall>();
godot::Godot::nativescript_init(handle);
godot::register_class<alai::StateMachine>();
godot::register_class<alai::State>();
godot::register_class<alai::main::Main>();
godot::register_class<alai::CameraLimit>();
godot::register_class<alai::player::Player>();
godot::register_class<alai::player::PlayerIdle>();
godot::register_class<alai::player::PlayerMove>();
godot::register_class<alai::player::PlayerJump>();
godot::register_class<alai::player::PlayerFall>();
}