make world abstract
All checks were successful
Linux arm64 / Build (pull_request) Successful in 1m36s

This commit is contained in:
2024-08-19 16:19:45 +02:00
parent 3cebb70289
commit a092f6fbc1
14 changed files with 180 additions and 65 deletions

View File

@@ -14,13 +14,12 @@ class World : public godot::Node3D, public protocol::PacketHandler {
protected:
static void _bind_methods();
public:
World();
~World();
public:
// Godot overrides
void _ready() override;
void _process(float delta);
Player* GetPlayerById(PlayerID a_PlayerId);
@@ -28,7 +27,7 @@ class World : public godot::Node3D, public protocol::PacketHandler {
void HandlePacket(const protocol::packets::PlayerLeave&) override;
void HandlePacket(const protocol::packets::PlayerPositionAndRotation&) override;
private:
protected:
NetworkInterface* m_NetworkInterface;
godot::Node* m_Players;
float m_PassedTime;

View File

@@ -0,0 +1,19 @@
#include <blitz/godot/World.h>
namespace blitz {
class ClientWorld : public World {
GDCLASS(ClientWorld, World)
protected:
static void _bind_methods();
public:
ClientWorld();
~ClientWorld();
void _process(float delta);
private:
void UpdatePlayerPos();
};
} // namespace blitz

View File

@@ -13,7 +13,9 @@ class Main : public godot::Node {
Main();
~Main();
void ChangeScene();
void _ready() override;
void ChangeScene(bool a_Server);
};
} // namespace blitz

View File

@@ -0,0 +1,19 @@
#include <blitz/godot/World.h>
namespace blitz {
class ServerWorld : public World {
GDCLASS(ServerWorld, World)
protected:
static void _bind_methods();
public:
ServerWorld();
~ServerWorld();
void _process(float delta);
private:
void SyncPlayersPos();
};
} // namespace blitz