// The original detector keeps its event state in translation-unit globals.
// Including the two implementations here lets the x86 runtime expose a reset
// without changing the Raspberry Pi source tree.
#include "../../src/detector/geometry/detection/motion_processing.cpp"

namespace motion_processing
{
void resetX86State()
{
    previous_frames.clear();
    initialized = false;
    motion_streamer.reset();
    motion2_streamer.reset();
    current_state = DartEventState::IDLE;
    cameras_spiked.clear();
    intensity_history.clear();
    stable_frame_count = 0;
}
} // namespace motion_processing

#include "../../src/detector/geometry/detection/dart_processing.cpp"

namespace dart_processing
{
void resetX86State()
{
    previous_states.assign(3, DartBoardState::CLEAN);
    best_previous_state = DartBoardState::CLEAN;
    stability_frame_count = 0;
    initialized = false;
    collecting_frames = false;
    accumulated_frames.clear();
    frames_collected = 0;
    working_backgrounds.clear();
    dart_diff_streamer.reset();
    dart_thresh_streamer.reset();
    dart_thresh_diff_streamer.reset();
    dart_tip_streamer.reset();
}
} // namespace dart_processing

#include "legacy_detection.hpp"

namespace legacy_detection
{
void resetAll()
{
    motion_processing::resetX86State();
    dart_processing::resetX86State();
}
} // namespace legacy_detection

