Added finish method to the NavigationServers.

This commit is contained in:
Relintai 2023-09-03 11:46:46 +02:00
parent 915014b6df
commit 9ae3aa65b7
5 changed files with 13 additions and 2 deletions

View File

@ -279,11 +279,14 @@ void initialize_navigation_server() {
}
void finalize_navigation_server() {
memdelete(navigation_server);
navigation_server = nullptr;
navigation_2d_server->finish();
navigation_server->finish();
memdelete(navigation_2d_server);
navigation_2d_server = nullptr;
memdelete(navigation_server);
navigation_server = nullptr;
}
//#define DEBUG_INIT

View File

@ -147,6 +147,9 @@ void Navigation2DServer::init() {
#endif // DEBUG_ENABLED
}
void Navigation2DServer::finish() {
}
void Navigation2DServer::query_path(const Ref<NavigationPathQueryParameters2D> &p_query_parameters, Ref<NavigationPathQueryResult2D> p_query_result) const {
ERR_FAIL_COND(!p_query_parameters.is_valid());
ERR_FAIL_COND(!p_query_result.is_valid());

View File

@ -259,6 +259,7 @@ public:
virtual NavigationUtilities::PathQueryResult2D _query_path(const NavigationUtilities::PathQueryParameters2D &p_parameters) const = 0;
virtual void init();
virtual void finish();
Navigation2DServer();
virtual ~Navigation2DServer();

View File

@ -47,6 +47,9 @@ NavigationServer *NavigationServer::singleton = nullptr;
void NavigationServer::init() {
}
void NavigationServer::finish() {
}
void NavigationServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_maps"), &NavigationServer::get_maps);

View File

@ -288,6 +288,7 @@ public:
virtual NavigationUtilities::PathQueryResult _query_path(const NavigationUtilities::PathQueryParameters &p_parameters) const = 0;
virtual void init();
virtual void finish();
enum ProcessInfo {
INFO_ACTIVE_MAPS,