yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::InteractionModeManager Class Reference

Manages interaction mode state and transitions. More...

#include <interaction_mode.h>

Collaboration diagram for yaze::editor::InteractionModeManager:

Public Member Functions

InteractionMode GetMode () const
 Get current interaction mode.
 
InteractionMode GetPreviousMode () const
 Get previous mode (for undo/escape handling)
 
void SetMode (InteractionMode mode)
 Set interaction mode.
 
void CancelCurrentMode ()
 Cancel current mode and return to Select.
 
bool IsPlacementActive () const
 Check if any placement mode is active.
 
bool IsSelectMode () const
 Check if in normal selection mode.
 
bool IsDragging () const
 Check if any dragging operation is in progress.
 
bool IsRectangleSelecting () const
 Check if rectangle selection is in progress.
 
bool IsObjectPlacementActive () const
 Check if object placement mode is active.
 
bool IsDoorPlacementActive () const
 Check if door placement mode is active.
 
bool IsSpritePlacementActive () const
 Check if sprite placement mode is active.
 
bool IsItemPlacementActive () const
 Check if item placement mode is active.
 
bool IsEntityPlacementActive () const
 Check if entity (non-object) placement is active.
 
ModeStateGetModeState ()
 Get mutable reference to mode state.
 
const ModeStateGetModeState () const
 Get const reference to mode state.
 
const char * GetModeName () const
 Get mode name for debugging/UI.
 

Private Attributes

InteractionMode current_mode_ = InteractionMode::Select
 
InteractionMode previous_mode_ = InteractionMode::Select
 
ModeState mode_state_
 

Detailed Description

Manages interaction mode state and transitions.

Provides a unified interface for mode management, replacing scattered boolean flags with explicit state machine semantics.

Usage: InteractionModeManager mode_manager;

// Enter placement mode mode_manager.SetMode(InteractionMode::PlaceObject); mode_manager.GetModeState().preview_object = some_object;

// Query mode if (mode_manager.IsPlacementActive()) { ... }

// Cancel and return to select mode_manager.CancelCurrentMode();

Definition at line 143 of file interaction_mode.h.

Member Function Documentation

◆ GetMode()

InteractionMode yaze::editor::InteractionModeManager::GetMode ( ) const
inline

Get current interaction mode.

Definition at line 148 of file interaction_mode.h.

References current_mode_.

Referenced by yaze::editor::DungeonObjectInteraction::CancelDoorPlacement(), yaze::editor::DungeonObjectInteraction::CancelItemPlacement(), yaze::editor::DungeonObjectInteraction::CancelSpritePlacement(), yaze::editor::DungeonObjectInteraction::ClearEntitySelection(), yaze::editor::DungeonObjectInteraction::ClearSelection(), yaze::editor::DungeonObjectInteraction::DrawDoorGhostPreview(), yaze::editor::DungeonObjectInteraction::DrawDoorSnapIndicators(), yaze::editor::DungeonObjectInteraction::DrawDragPreview(), yaze::editor::DungeonObjectInteraction::DrawEntitySelectionHighlights(), yaze::editor::DungeonObjectInteraction::DrawGhostPreview(), yaze::editor::DungeonObjectInteraction::DrawItemGhostPreview(), yaze::editor::DungeonObjectInteraction::DrawSpriteGhostPreview(), yaze::editor::DungeonObjectInteraction::HandleCanvasMouseInput(), yaze::editor::DungeonObjectInteraction::HandleEntityDrag(), yaze::editor::DungeonObjectInteraction::IsDoorPlacementActive(), yaze::editor::DungeonObjectInteraction::IsItemPlacementActive(), yaze::editor::DungeonObjectInteraction::IsObjectLoaded(), yaze::editor::DungeonObjectInteraction::IsSpritePlacementActive(), yaze::editor::DungeonObjectInteraction::PlaceDoorAtPosition(), yaze::editor::DungeonObjectInteraction::PlaceItemAtPosition(), yaze::editor::DungeonObjectInteraction::PlaceSpriteAtPosition(), yaze::editor::DungeonObjectInteraction::SetDoorPlacementMode(), yaze::editor::DungeonObjectInteraction::SetItemPlacementMode(), yaze::editor::DungeonObjectInteraction::SetPreviewObject(), and yaze::editor::DungeonObjectInteraction::SetSpritePlacementMode().

◆ GetPreviousMode()

InteractionMode yaze::editor::InteractionModeManager::GetPreviousMode ( ) const
inline

Get previous mode (for undo/escape handling)

Definition at line 153 of file interaction_mode.h.

References previous_mode_.

◆ SetMode()

◆ CancelCurrentMode()

void yaze::editor::InteractionModeManager::CancelCurrentMode ( )

◆ IsPlacementActive()

bool yaze::editor::InteractionModeManager::IsPlacementActive ( ) const
inline

◆ IsSelectMode()

bool yaze::editor::InteractionModeManager::IsSelectMode ( ) const
inline

Check if in normal selection mode.

Definition at line 183 of file interaction_mode.h.

References current_mode_, and yaze::editor::Select.

◆ IsDragging()

bool yaze::editor::InteractionModeManager::IsDragging ( ) const
inline

Check if any dragging operation is in progress.

Definition at line 188 of file interaction_mode.h.

References current_mode_, yaze::editor::DraggingEntity, and yaze::editor::DraggingObjects.

◆ IsRectangleSelecting()

bool yaze::editor::InteractionModeManager::IsRectangleSelecting ( ) const
inline

Check if rectangle selection is in progress.

Definition at line 196 of file interaction_mode.h.

References current_mode_, and yaze::editor::RectangleSelect.

◆ IsObjectPlacementActive()

bool yaze::editor::InteractionModeManager::IsObjectPlacementActive ( ) const
inline

Check if object placement mode is active.

Definition at line 203 of file interaction_mode.h.

References current_mode_, and yaze::editor::PlaceObject.

Referenced by yaze::editor::DungeonObjectInteraction::PlaceObjectAtPosition().

◆ IsDoorPlacementActive()

bool yaze::editor::InteractionModeManager::IsDoorPlacementActive ( ) const
inline

Check if door placement mode is active.

Definition at line 210 of file interaction_mode.h.

References current_mode_, and yaze::editor::PlaceDoor.

◆ IsSpritePlacementActive()

bool yaze::editor::InteractionModeManager::IsSpritePlacementActive ( ) const
inline

Check if sprite placement mode is active.

Definition at line 217 of file interaction_mode.h.

References current_mode_, and yaze::editor::PlaceSprite.

◆ IsItemPlacementActive()

bool yaze::editor::InteractionModeManager::IsItemPlacementActive ( ) const
inline

Check if item placement mode is active.

Definition at line 224 of file interaction_mode.h.

References current_mode_, and yaze::editor::PlaceItem.

◆ IsEntityPlacementActive()

bool yaze::editor::InteractionModeManager::IsEntityPlacementActive ( ) const
inline

Check if entity (non-object) placement is active.

Definition at line 231 of file interaction_mode.h.

References current_mode_, yaze::editor::PlaceDoor, yaze::editor::PlaceItem, and yaze::editor::PlaceSprite.

◆ GetModeState() [1/2]

◆ GetModeState() [2/2]

const ModeState & yaze::editor::InteractionModeManager::GetModeState ( ) const
inline

Get const reference to mode state.

Definition at line 245 of file interaction_mode.h.

References mode_state_.

◆ GetModeName()

const char * yaze::editor::InteractionModeManager::GetModeName ( ) const

Member Data Documentation

◆ current_mode_

◆ previous_mode_

InteractionMode yaze::editor::InteractionModeManager::previous_mode_ = InteractionMode::Select
private

Definition at line 254 of file interaction_mode.h.

Referenced by CancelCurrentMode(), GetPreviousMode(), and SetMode().

◆ mode_state_

ModeState yaze::editor::InteractionModeManager::mode_state_
private

Definition at line 255 of file interaction_mode.h.

Referenced by CancelCurrentMode(), GetModeState(), GetModeState(), and SetMode().


The documentation for this class was generated from the following files: