1
0
Fork 0
Univerxel/src/client/world/DistantUniverse.hpp

36 lines
873 B
C++

#pragma once
#include "Universe.hpp"
#include "../../core/net/Client.hpp"
#include "../../core/utils/zctx.hpp"
namespace world::client {
class Area;
/// Whole universe container in network client
class DistantUniverse final: public Universe {
public:
DistantUniverse(const connection&, const options &);
~DistantUniverse();
void update(voxel_pos, float) override;
void emit(const action::packet &) override;
ray_result raycast(const geometry::Ray &) const override;
protected:
void pullNetwork(voxel_pos);
/// Alive areas containing chunks
area_map areas;
net::Client peer;
std::optional<zstd::read_dict_ctx> dict;
chunk_pos last_chunk = chunk_pos(INT_MAX);
ushort loadDistance;
ushort keepDistance;
ushort serverDistance;
};
}