1#ifndef YAZE_APP_EDITOR_DUNGEON_DUNGEON_SELECTION_SNAPSHOT_H_
2#define YAZE_APP_EDITOR_DUNGEON_DUNGEON_SELECTION_SNAPSHOT_H_
53 const char* plural =
nullptr) {
54 if (count == 0 || parts ==
nullptr) {
57 parts->push_back(std::to_string(count) +
" " +
58 (count == 1 || plural ==
nullptr ? singular : plural));
68 if (!selected_objects.empty()) {
71 if (rooms !=
nullptr && room_id >= 0 &&
72 room_id <
static_cast<int>(rooms->
size())) {
73 const auto& objects = (*rooms)[room_id].GetTileObjects();
74 if (selected_objects.front() < objects.size()) {
80 auto selected_entities =
85 selected_entities.push_back(selected);
92 snapshot.
entity = selected;
94 switch (selected.type) {
111 const size_t entity_count =
114 if (snapshot.
count == 0) {
127 if (entity_count > 1) {
153 switch (snapshot.
kind) {
160 return std::to_string(snapshot.
count) +
" obj";
169 std::vector<std::string> parts;
178 std::string summary = std::to_string(snapshot.
count) +
" selected";
179 if (!parts.empty()) {
181 for (
size_t i = 0; i < parts.size(); ++i) {
192 return "No selection";
Handles object selection, placement, and interaction within the dungeon canvas.
SelectedEntity GetSelectedEntity() const
std::vector< size_t > GetSelectedObjectIndices() const
InteractionCoordinator & entity_coordinator()
Get the interaction coordinator for entity handling.
bool HasEntitySelection() const
const std::vector< SelectedEntity > & GetSelectedEntities() const
Editors are the view controllers for the application.
DungeonSelectionSnapshot BuildDungeonSelectionSnapshot(const DungeonObjectInteraction &interaction, const DungeonRoomStore *rooms, int room_id)
const char * GetDungeonSelectionKindLabel(DungeonSelectionKind kind)
std::string GetDungeonSelectionSummaryText(const DungeonSelectionSnapshot &snapshot)
void AppendDungeonSelectionSummaryPart(std::vector< std::string > *parts, size_t count, const char *singular, const char *plural=nullptr)
bool HasMixedSelection() const
std::optional< size_t > primary_object_index
bool HasSelection() const
bool HasEntitySelection() const
DungeonSelectionKind kind
bool HasObjectSelection() const
Represents a selected entity in the dungeon editor.