#pragma once

#include "application/contracts/IApplicationTick.h"
#include "application/contracts/IGameTick.h"
#include "features/aimbot/IAimbotGateway.h"
#include "features/aimbot/IAimbotInput.h"
#include "features/aimbot/IAimbotSettings.h"
#include "features/common/SettingsCache.h"

namespace ta::features::aimbot
{
    class AimbotFeature final : public ta::application::IApplicationTick,
                                public ta::application::IGameTick
    {
    public:
        AimbotFeature(IAimbotGateway& gateway,
                      IAimbotSettings& settings,
                      IAimbotInput& input) noexcept
            : gateway_(gateway), settings_(settings), input_(input)
        {
        }

        void initialize();
        void on_application_tick() override;
        void on_game_tick() override;
        void reset_session() noexcept;

    private:
        [[nodiscard]] AimbotSettings current_settings() const;

        IAimbotGateway& gateway_;
        IAimbotSettings& settings_;
        IAimbotInput& input_;
        ta::features::SettingsCache<AimbotSettings> settings_cache_;
    };
}
