#pragma once

#include <SDL3/SDL.h>

/**
 * @brief Abstract interface for input handling operations
 * 
 * Provides a common interface for input processing,
 * enabling dependency injection and easier testing.
 */
class IInputHandler {
public:
    virtual ~IInputHandler() = default;
    
    /**
     * @brief Process SDL events
     * @param event SDL event to process
     * @return true if event was handled, false otherwise
     */
    virtual bool processEvent(const SDL_Event& event) = 0;
    
    /**
     * @brief Update input state (called per frame)
     * @param deltaTime Time elapsed since last frame in milliseconds
     */
    virtual void update(double deltaTime) = 0;
    
    /**
     * @brief Check if a key is currently pressed (interface method)
     * @param scancode SDL scancode of the key
     * @return true if key is pressed, false otherwise
     */
    virtual bool isKeyCurrentlyPressed(SDL_Scancode scancode) const = 0;
    
    /**
     * @brief Check if a key was just pressed this frame
     * @param scancode SDL scancode of the key
     * @return true if key was just pressed, false otherwise
     */
    virtual bool isKeyJustPressed(SDL_Scancode scancode) const = 0;
    
    /**
     * @brief Check if a key was just released this frame
     * @param scancode SDL scancode of the key
     * @return true if key was just released, false otherwise
     */
    virtual bool isKeyJustReleased(SDL_Scancode scancode) const = 0;
    
    /**
     * @brief Check if quit was requested (e.g., Alt+F4, window close)
     * @return true if quit was requested, false otherwise
     */
    virtual bool isQuitRequested() const = 0;
    
    /**
     * @brief Reset input state (typically called at frame start)
     */
    virtual void reset() = 0;
};
