Reshape game-world selection into two categories: buildings (exclusive, win all ties) and field objects (ships, defence stations, scrap) that coexist. Ships/stations are now multi-selectable via Ctrl+click and box-drag and can be selected together with scrap; the Selected panel shows a single-actor stats panel or a multi-actor summary plus the scrap total. - Widen EntitySelectedEvent to std::vector<entt::entity> - Add actorsInBox() ECS query (+ Catch2 test) - GameWorldView: vector actor selection, building>actor>scrap hit-test, actor Ctrl-toggle/box-select, membership highlights, per-frame prune - SelectedBuildingPanel: buildFieldSelection composition, buildEntitySummary - ArenaView/InspectWindow: adapt to vector payload (single-select) Implements REQ-UI-SELECTION-CATEGORIES, REQ-UI-FIELD-MULTI-SELECTION and the updated entity/scrap selection requirements. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
29 lines
1.2 KiB
C++
29 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <vector>
|
|
|
|
#include <QPoint>
|
|
#include <QVector2D>
|
|
|
|
#include "entt/entity/entity.hpp"
|
|
|
|
class EntityAdmin;
|
|
|
|
entt::entity entityAtWorldPos(EntityAdmin& admin, QVector2D worldPos);
|
|
|
|
// Returns the nearest scrap pile whose center is within the scrap pick radius of
|
|
// worldPos, or entt::null if none (REQ-UI-SCRAP-CLICK-SELECT). Scrap is picked only
|
|
// after actors: entityAtWorldPos never returns scrap (scrap has no HealthComponent).
|
|
entt::entity scrapAtWorldPos(EntityAdmin& admin, QVector2D worldPos);
|
|
|
|
// Returns every scrap pile whose position falls within the inclusive tile rectangle
|
|
// spanned by tileA and tileB, in any corner order (REQ-UI-SCRAP-MULTI-SELECT).
|
|
std::vector<entt::entity> scrapInBox(EntityAdmin& admin, QPoint tileA, QPoint tileB);
|
|
|
|
// Returns every living actor (ship or defence station, player or enemy) that falls
|
|
// within the inclusive tile rectangle spanned by tileA and tileB, in any corner order
|
|
// (REQ-UI-MULTI-SELECT, REQ-UI-ENTITY-CLICK-SELECT). A ship is included when its floored
|
|
// position tile lies in the box; a station is included when any of its body cells does.
|
|
// Dead actors (hp <= 0) and the HQ proxy are excluded.
|
|
std::vector<entt::entity> actorsInBox(EntityAdmin& admin, QPoint tileA, QPoint tileB);
|