#pragma once

#include <client/Player.h>
#include <godot_cpp/classes/input_event_mouse_motion.hpp>

namespace blitz {

class FirstPersonPlayer : public Player {
	GDCLASS(FirstPersonPlayer, godot::CharacterBody3D)
  protected:
	static void _bind_methods();

  public:
	FirstPersonPlayer();
	~FirstPersonPlayer();

	// Godot overrides
	void _unhandled_input(const godot::Ref<godot::InputEvent>&);
	void _physics_process(float delta) override;
	void _ready() override;

  private:
	godot::Camera3D* m_Camera;
	godot::Node3D* m_Head;
	float m_BobTime;
	float m_Speed;

	void UpdateBobbing(float delta);
	void UpdateFOV(float delta);
	void UpdateCamera(const godot::InputEventMouseMotion&);
	void UpdatePosition(float delta);

	void UpdateAnimation(float delta);
};

}  // namespace blitz