feat: add Config class

This commit is contained in:
2026-04-24 17:08:06 +08:00
parent 2409734e89
commit 106cc3d398
20 changed files with 465 additions and 154 deletions

View File

@@ -13,7 +13,7 @@ Player::Player(World& world, const std::string& name) :
m_name(name),
m_world(world)
{
hot_reload();
}
Player::~Player() {
@@ -144,6 +144,12 @@ void Player::change_mode(GameMode mode) {
}
}
void Player::hot_reload() {
auto& config = Config::get();
m_sensitivity = static_cast<float>(config.get<double>("player.mouse_sensitivity"));
}
void Player::set_player_pos(const glm::vec3& pos) {
m_player_pos = pos;
}