feat: added get_singleton() functions to c/s-nodes

This commit is contained in:
Sara Gerretsen 2025-10-13 17:25:15 +02:00
parent a5df2ff598
commit badf83cf91
4 changed files with 12 additions and 0 deletions

View file

@ -50,6 +50,10 @@ void ClientNode::_notification(int what) {
}
}
ClientNode *ClientNode::get_singleton() {
return singleton_instance;
}
void ClientNode::connect_to_server(String const &server) {
ydi::client::connect(server);
}

View file

@ -15,6 +15,7 @@ protected:
void _notification(int what);
public:
static ClientNode *get_singleton();
void connect_to_server(String const &url);
private:

View file

@ -62,3 +62,7 @@ void ServerNode::_notification(int what) {
return;
}
}
ServerNode *ServerNode::get_singleton() {
return singleton_instance;
}

View file

@ -13,6 +13,9 @@ class ServerNode : public Node {
protected:
void _notification(int what);
public:
static ServerNode *get_singleton();
public:
static String const sig_clue_revealed;
static String const sig_connection_established;