DragPathData

DragPathData

Drag data for a single drag operation between a start and end position. Ported from GDScript DragPathData class. POCS version - no Godot dependencies.

Project: GridPlacement v6.0
Layer: Core
Source: Core/_incomplete/Systems/Data/DragPathData.cs
Namespace: GridBuilding.Core.Systems.Data
Kind: class

Parsing Method: AST-based (Roslyn) - NOT regex

⚠️ IMPORTANT: This documentation was generated using AST parsing, not regex.

Properties

StartPosition

Starting position of the drag.

CurrentPosition

Current position during the drag.

TimeHeld

Time the drag has been held (in seconds).

DragDistance

Total distance dragged.

LastTile

Last tile position during drag.

TargetTile

Target tile position for drag.

NextTile

Next tile position in drag path.

LastAttemptedTile

Last attempted tile position (initialized to invalid coordinates).

BuildRequests

Number of build requests made during this drag session. Incremented each time DragManager calls BuildingSystem.try_build(). Useful for monitoring drag-build behavior and verifying request throttling.

Positioner

Reference to positioner node (POCS - uses object reference).

TargetingState

Reference to targeting state (POCS - uses object reference).

IsDragging

Whether the drag is currently active.

Methods

UpdatePosition

Updates the current position and calculates drag metrics.

Returns: void

Parameters:

  • CoreVector2 newPosition

IncrementBuildRequests

Increments the build request counter.

Returns: void

GetTileAtPosition

Gets the tile position at a given world position. POCS version - returns rounded position as tile coordinate.

Returns: CoreVector2I

Parameters:

  • CoreVector2 worldPosition

HasMovedToNewTile

Checks if the drag has moved to a new tile.

Returns: bool

UpdateLastTile

Updates the last tile to the current target tile.

Returns: void

GetDirection

Gets the direction vector of the drag.

Returns: CoreVector2

GetAngle

Gets the angle of the drag in radians.

Returns: float

Reset

Resets the drag data for reuse.

Returns: void

ToString

Creates a string representation of the drag data.

Returns: string

FromPositions

Creates a DragPathData instance from world positions.

Returns: DragPathData

Parameters:

  • CoreVector2 startPosition
  • CoreVector2 currentPosition
  • object? positioner
  • object? targetingState