1#ifndef YAZE_APP_EDITOR_DUNGEON_INTERACTION_INTERACTION_COORDINATOR_H_
2#define YAZE_APP_EDITOR_DUNGEON_INTERACTION_INTERACTION_COORDINATOR_H_
108 bool additive,
bool toggle);
123 void HandleDrag(ImVec2 current_pos, ImVec2 delta);
214 bool defer_drag_notifications);
219 const std::vector<SelectedEntity>& hits)
const;
222 const std::vector<SelectedEntity>& hits)
const;
Abstract base class for entity interaction handlers.
Handles door placement and interaction in the dungeon editor.
Coordinates interaction mode switching and dispatches to handlers.
const DoorInteractionHandler & door_handler() const
ItemInteractionHandler & item_handler()
bool ApplySelection(SelectedEntity entity)
const std::vector< SelectedEntity > & GetSelectedEntities() const
std::vector< SelectedEntity > GetEntitiesAtPosition(int canvas_x, int canvas_y) const
bool IsSelectionHitSelected(SelectedEntity entity) const
bool entity_group_drag_active_
bool entity_group_drag_sprites_changed_
SelectedEntity GetSelectedEntity() const
void DrawSelectionCycleHud()
bool TrySelectEntityAtCursor(int canvas_x, int canvas_y)
Try to select entity at cursor position.
void UpdateSelectionCycleHudPreview()
bool HasGroupDragSelection() const
ImVec2 entity_group_drag_start_
void HandleRelease()
Handle mouse release.
bool entity_group_drag_doors_changed_
Mode GetSelectedEntityType() const
Get the type of currently selected entity.
int entity_group_drag_last_dx_
std::string DescribeCycleHudEntity(SelectedEntity entity) const
InteractionContext * ctx_
ItemInteractionHandler item_handler_
const TileObjectHandler & tile_handler() const
void SelectEntitiesInRect(const std::tuple< int, int, int, int > &bounds, bool additive, bool toggle)
void ClearEntitySelection()
void CancelCurrentMode()
Cancel current mode and return to select mode.
Mode GetCurrentMode() const
Get current interaction mode.
SpriteInteractionHandler & sprite_handler()
void SetContext(InteractionContext *ctx)
Set the shared interaction context.
void FinishEntityGroupDrag()
void BeginSelectionDrag(ImVec2 start_pos)
std::vector< SelectedEntity > selected_entities_
bool UpdateEntitySelection(SelectedEntity entity, bool additive, bool toggle)
std::optional< size_t > FindSelectedCycleIndex(const std::vector< SelectedEntity > &hits) const
BaseEntityHandler * GetActiveHandler()
Get active handler based on current mode.
void DeleteSelectedEntity()
Delete currently selected entity.
ImVec2 entity_group_drag_current_
bool IsPlacementActive() const
Check if any placement mode is active.
bool HandleClick(int canvas_x, int canvas_y)
Handle click at canvas position.
bool entity_group_drag_items_mutation_started_
void SetSelectedEntities(std::vector< SelectedEntity > entities)
std::string DescribeEntity(SelectedEntity entity) const
size_t cycle_active_index_
DoorInteractionHandler door_handler_
void ResetEntityGroupDragState()
void SelectEntity(EntityType type, size_t index)
void DrawMultiEntitySelectionHighlights()
int entity_group_drag_last_dy_
double cycle_hud_start_time_
void DrawPostPlacementOverlays()
Draw post-placement success toasts for all handlers (unconditional)
ImVec2 cycle_hud_screen_pos_
const SpriteInteractionHandler & sprite_handler() const
bool NudgeSelected(int delta_x, int delta_y)
bool HandleMouseWheel(float delta)
TileObjectHandler & tile_handler()
TileObjectHandler tile_handler_
void HandleEntityGroupDrag(ImVec2 current_pos)
void DrawSelectionHighlights()
Draw selection highlights for all entity types.
const ItemInteractionHandler & item_handler() const
bool entity_group_drag_sprites_mutation_started_
DoorInteractionHandler & door_handler()
void SetMode(Mode mode)
Set interaction mode.
Mode
Available interaction modes.
void ClearAllEntitySelections()
Clear all entity selections.
bool entity_group_drag_doors_mutation_started_
bool entity_group_drag_items_changed_
void DrawGhostPreviews()
Draw ghost previews for active placement mode.
bool SameCycleTarget(int canvas_x, int canvas_y, const std::vector< SelectedEntity > &hits) const
bool HasEntitySelection() const
bool NudgeSelectedEntities(int delta_x, int delta_y, bool defer_drag_notifications)
SpriteInteractionHandler sprite_handler_
std::vector< SelectedEntity > cycle_last_hits_
std::optional< SelectedEntity > GetEntityAtPosition(int canvas_x, int canvas_y) const
void HandleDrag(ImVec2 current_pos, ImVec2 delta)
Handle drag operation.
Handles pot item placement and interaction in the dungeon editor.
Handles sprite placement and interaction in the dungeon editor.
Handles functional mutations and queries for tile objects.
EntityType
Type of entity that can be selected in the dungeon editor.
Shared context for all interaction handlers.
Represents a selected entity in the dungeon editor.