#pragma once

// -----------------------------------------------------------------------------
// forceaim.h
// -----------------------------------------------------------------------------
// ForceAimFeature: holding ALT aims at the enemy closest to the crosshair.
// The screen is treated as a 4x4 grid; the active area is the middle 3x3
// block (12.5%..87.5% of both axes) and only enemies inside it are
// eligible. If the area is empty the feature does nothing. Targets are
// selected by projecting each enemy onto the screen with the view matrix
// (dwViewMatrix). The view angle is moved by smoothAmount/100 of the
// remaining delta every frame (with velocity prediction) - a fast sweep
// instead of an instant snap. The mouse is only ever moved while ALT is
// held.
// -----------------------------------------------------------------------------

#include "../core/memory.h"
#include "../core/offsets.h"
#include "../sdk/entitylist.h"
#include "../sdk/localplayer.h"

namespace features {

// Nearest-enemy aim assist running on its own thread.
class ForceAim
{
public:
	// Binds the memory reader, offsets, entity list and local player.
	void Initialize(const core::ProcessMemory* memory, const core::GameOffsets* offsets,
		const sdk::EntityList* entities, const sdk::LocalPlayer* player);

	// Starts the force-aim thread.
	void Start();

	// Thread entry point.
	static unsigned long __stdcall ThreadProc(void* param);

private:
	const core::ProcessMemory* m_memory = nullptr;
	const core::GameOffsets* m_offsets = nullptr;
	const sdk::EntityList* m_entities = nullptr;
	const sdk::LocalPlayer* m_player = nullptr;
};

} // namespace features