Grid Placement
Development ⚠️ GridPlacement 6.0 (GECS) is in active development. This is the GDScript ECS architecture.

DragSystem

AUTO-GENERATED (GDScript) API entry

AUTO-GENERATED FILE — DO NOT EDIT MANUALLY

Source: systems/interaction/drag_system.gd

Version: 6.0

class_name: DragSystem extends: System

Signals

  • PlacementSignalBus

Exports

  • default_placement_cooldown: float = 0.1
    • Performance settings
    • Private state
  • max_placement_rate: float = 10.0
    • Performance settings
    • Private state
  • enable_placement_validation: bool = true
    • Performance settings
    • Private state
  • max_active_drags: int = 5
    • Private state
  • cleanup_inactive_after: float = 5.0
    • Private state

Methods

  • query -> QueryBuilder
  • process(entities: Array, components: Array, delta: float) -> void
    • Event-driven system - minimal per-frame processing
  • setup -> void
    • Connect to target change signals
  • cleanup -> void
    • Disconnect from target change signals
  • _process_drag_component(entity: Entity, drag: DragComponent, delta: float) -> void
    • Handle different drag states
  • _update_drag_timing(drag: DragComponent, delta: float) -> void
  • _connect_target_change_signals -> void
  • _disconnect_target_change_signals -> void
  • _setup_cleanup_timer -> void
  • _cleanup_timer -> void
  • _on_cleanup_timer_timeout -> void
  • _update_active_drag_cache(entities: Array, drag_components: Array) -> void
  • _process_active_drags_only(entities: Array, drag_components: Array, delta: float) -> void
    • Only process cached active drag entities
  • _on_target_changed(event: TargetChangedEvent) -> void
    • Fallback for cases where cache has not been populated yet
  • _perform_event_driven_cleanup -> void
    • Use cached active drag entities for efficiency
  • start_drag(placeable_entity: Entity, source: String = "mouse", input_id: int = -1) -> DragComponent
    • Create drag entity
  • end_drag(drag_entity: Entity) -> void
  • get_active_drags -> Array
  • update_drag_position(drag_entity: Entity, new_grid_position: Vector2i) -> void
  • get_drag_statistics(drag: DragComponent) -> Dictionary
  • _init_drag_session(drag: DragComponent, entity: Entity, source: String, input_id: int) -> void
  • _reset_drag(drag: DragComponent) -> void
  • _update_drag_position(drag: DragComponent, new_grid_position: Vector2i) -> void
  • _can_place_at_current_position(drag: DragComponent) -> bool
    • Check cooldown
  • _trigger_placement(drag: DragComponent) -> void
  • _emit_placement_request(drag: DragComponent) -> void
  • _emit_drag_start_event(entity: Entity, drag: DragComponent) -> void
  • _emit_drag_update_event(entity: Entity, drag: DragComponent, target_event: TargetChangedEvent) -> void
  • _emit_drag_end_event(entity: Entity, drag: DragComponent) -> void
  • get_all_drag_trails -> Array
  • clear_all_drag_trails -> void
  • set_placement_cooldown(cooldown: float) -> void
  • set_max_placement_rate(rate: float) -> void