generated from Persson-dev/Godot-Xmake
make world abstract
This commit is contained in:
@@ -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;
|
||||
19
include/client/ClientWorld.h
Normal file
19
include/client/ClientWorld.h
Normal 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
|
||||
@@ -13,7 +13,9 @@ class Main : public godot::Node {
|
||||
Main();
|
||||
~Main();
|
||||
|
||||
void ChangeScene();
|
||||
void _ready() override;
|
||||
|
||||
void ChangeScene(bool a_Server);
|
||||
};
|
||||
|
||||
} // namespace blitz
|
||||
19
include/server/ServerWorld.h
Normal file
19
include/server/ServerWorld.h
Normal 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
|
||||
Reference in New Issue
Block a user