X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fserver%2FServer.hpp;h=372a947ef65fe0e14c1aa209d091036fcd47ed6b;hb=825f479edf9867938b6789215ad7ae6303596cba;hp=8bbb778a91b358a51cbb3d836cf64423fd4952a5;hpb=8ae45b6555d55f301f83daf8c1337d332d8305ab;p=blank.git diff --git a/src/server/Server.hpp b/src/server/Server.hpp index 8bbb778..372a947 100644 --- a/src/server/Server.hpp +++ b/src/server/Server.hpp @@ -1,27 +1,28 @@ #ifndef BLANK_SERVER_SERVER_HPP #define BLANK_SERVER_SERVER_HPP +#include "../app/Config.hpp" +#include "../world/WorldManipulator.hpp" + #include #include namespace blank { +class CompositeModel; class World; +class WorldSave; namespace server { class ClientConnection; -class Server { - -public: - struct Config { - Uint16 port = 12354; - }; +class Server +: public WorldManipulator { public: - Server(const Config &, World &); + Server(const Config::Network &, World &, const WorldSave &); ~Server(); void Handle(); @@ -32,6 +33,13 @@ public: UDPpacket &GetPacket() noexcept { return serv_pack; } World &GetWorld() noexcept { return world; } + const WorldSave &GetWorldSave() noexcept { return save; } + + void SetPlayerModel(const CompositeModel &) noexcept; + bool HasPlayerModel() const noexcept; + const CompositeModel &GetPlayerModel() const noexcept; + + void SetBlock(Chunk &, int, const Block &) override; private: void HandlePacket(const UDPpacket &); @@ -44,6 +52,8 @@ private: std::list clients; World &world; + const WorldSave &save; + const CompositeModel *player_model; };