yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
interaction_coordinator.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_DUNGEON_INTERACTION_INTERACTION_COORDINATOR_H_
2#define YAZE_APP_EDITOR_DUNGEON_INTERACTION_INTERACTION_COORDINATOR_H_
3
8
9namespace yaze {
10namespace editor {
11
20 public:
24 enum class Mode {
25 Select, // Normal selection mode (no placement)
26 PlaceDoor, // Door placement mode
27 PlaceSprite, // Sprite placement mode
28 PlaceItem // Item placement mode
29 };
30
37
41 Mode GetCurrentMode() const { return current_mode_; }
42
48 void SetMode(Mode mode);
49
53 void CancelCurrentMode();
54
58 bool IsPlacementActive() const;
59
60 // ========================================================================
61 // Handler Access
62 // ========================================================================
63
66
71
74
75 // ========================================================================
76 // Unified Interaction Methods
77 // ========================================================================
78
85 bool HandleClick(int canvas_x, int canvas_y);
86
90 void HandleDrag(ImVec2 current_pos, ImVec2 delta);
91
95 void HandleRelease();
96
100 void DrawGhostPreviews();
101
106
107 // ========================================================================
108 // Entity Selection
109 // ========================================================================
110
117 bool TrySelectEntityAtCursor(int canvas_x, int canvas_y);
118
122 bool HasEntitySelection() const;
123
128
133
139
140 private:
143
147
153};
154
155} // namespace editor
156} // namespace yaze
157
158#endif // YAZE_APP_EDITOR_DUNGEON_INTERACTION_INTERACTION_COORDINATOR_H_
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
bool TrySelectEntityAtCursor(int canvas_x, int canvas_y)
Try to select entity at cursor position.
Mode GetSelectedEntityType() const
Get the type of currently selected entity.
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.
BaseEntityHandler * GetActiveHandler()
Get active handler based on current mode.
void DeleteSelectedEntity()
Delete currently selected entity.
bool IsPlacementActive() const
Check if any placement mode is active.
bool HandleClick(int canvas_x, int canvas_y)
Handle click at canvas position.
const SpriteInteractionHandler & sprite_handler() const
void DrawSelectionHighlights()
Draw selection highlights for all entity types.
const ItemInteractionHandler & item_handler() const
void SetMode(Mode mode)
Set interaction mode.
void ClearAllEntitySelections()
Clear all entity selections.
void DrawGhostPreviews()
Draw ghost previews for active placement mode.
bool HasEntitySelection() const
Check if any entity is selected.
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.
Shared context for all interaction handlers.