35 lines
836 B
C++
35 lines
836 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);
|
|
|
|
int loadDistance;
|
|
int keepDistance;
|
|
};
|
|
} |