#include "sc2k/ui/structure_hover.hpp" #include using namespace sc2k; #include "test_harness.hpp" int main() { ui::ObjectHoverState hover; const render::ObjectSelection tower{60, 63}; CHECK(hover.update_from_pointer(tower)); CHECK(hover.selection() == tower); // A simulation tick rebuilds the rotated scene while the pointer remains stationary. The last // pointer result must stay latched until fresh input replaces it. hover.scene_reprojected(); CHECK(hover.selection() == tower); CHECK(!hover.update_from_pointer(tower)); CHECK(hover.clear_for_pointer_block()); CHECK(!hover.selection()); CHECK(!hover.clear_for_pointer_block()); if (failures == 0) std::puts("structure_hover: lifecycle checks passed"); return failures == 0 ? 0 : 1; }