diff options
| author | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2025-02-12 21:57:46 +1100 |
|---|---|---|
| committer | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2025-02-12 21:57:46 +1100 |
| commit | e4483eca01b48b943cd0461e24a74ae1a3139ed4 (patch) | |
| tree | ed58c3c246e3af1af337697695d780aa31f6ad9a /src/client/state/state.hh | |
| parent | 1cc08c51eb4b0f95c30c0a98ad1fc5ad3459b2df (diff) | |
Update to most recent version (old initial commit)
Diffstat (limited to 'src/client/state/state.hh')
| -rw-r--r-- | src/client/state/state.hh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/client/state/state.hh b/src/client/state/state.hh new file mode 100644 index 0000000..cfbb440 --- /dev/null +++ b/src/client/state/state.hh @@ -0,0 +1,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 |
