blob: cfbb440ce72cd50f041ee299303e709b38a0b85e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#ifndef CLIENT_STATE_STATE_HH_
#define CLIENT_STATE_STATE_HH_
#include <optional>
#include "shared/entity/entity.hh"
#include "shared/net/connection.hh"
#include "shared/shared.hh"
namespace client {
namespace state {
inline std::string_view address;
inline std::string_view port;
inline std::uint64_t seed;
inline std::size_t player_count;
inline std::size_t requested_chunk_count;
inline std::size_t networked_chunk_count;
inline std::int32_t draw_distance;
inline std::int32_t chunks_per_frame;
inline std::uint32_t tickrate;
inline shared::tick_t tick;
inline float delta_ticks; // num ticks since the last tick, [0, inf)
shared::time_duration_t get_time_per_tick() noexcept;
// Speed of the client's move ticks should be 1.0f but if we're too slow (or the
// server lags and we're too fast) this value should move to speed up the client
// somewhat gracefully.
inline float time_factor = 1.0f;
inline shared::net::connection* connection = nullptr;
// non-opt after init
inline std::optional<shared::entity::index_t> localplayer_index;
bool has_initialised() noexcept;
} // namespace state
} // namespace client
#endif
|