IManipulationService

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

This page documents the supported public API surface only. Private, internal, benchmark, test, and implementation-detail types are intentionally omitted.

Declaration

1
public interface IManipulationService

Summary

Interface for manipulation-related business logic and state management. Handles object manipulation operations like move, rotate, scale, and complex transformations.

NOTE: For ECS-based implementations, use the GridPlacement.Godot.ECS project which provides ECS systems and components for manipulation.

Metadata

Namespace: GridPlacement.Core.Services.Manipulation

Source File: cs/Core/Services/Manipulation/IManipulationService.cs

Assembly: GridPlacement.Core

Type: interface

Methods

StartManipulation

1
2
3
4
ManipulationState StartManipulation(
    GridMode mode,
    CoreVector2I origin
)

Starts a new manipulation session.

Parameters

NameDescription
modeGrid mode that the manipulation represents.
originGrid origin position.

Returns

The created manipulation state.


UpdateManipulationTarget

1
2
3
4
bool UpdateManipulationTarget(
    string manipulationId,
    CoreVector2I target
)

Updates the target position for an active manipulation.

Parameters

NameDescription
manipulationIdManipulation identifier.
targetNew target position.

Returns

True if the target was updated.


CancelManipulation

1
bool CancelManipulation(string manipulationId)

Cancels an active manipulation.

Parameters

NameDescription
manipulationIdManipulation identifier.

Returns

True if the manipulation was cancelled.


CompleteManipulation

1
bool CompleteManipulation(string manipulationId)

Completes an active manipulation.

Parameters

NameDescription
manipulationIdManipulation identifier.

Returns

True if the manipulation was completed.


AddConstraint

1
2
3
4
bool AddConstraint(
    string manipulationId,
    ManipulationConstraint constraint
)

Adds a constraint to the manipulation.

Parameters

NameDescription
manipulationIdManipulation identifier.
constraintConstraint to add.

Returns

True if the constraint was added.


RemoveConstraint

1
2
3
4
bool RemoveConstraint(
    string manipulationId,
    string constraintId
)

Removes a constraint from the manipulation.

Parameters

NameDescription
manipulationIdManipulation identifier.
constraintIdConstraint identifier.

Returns

True if the constraint was removed.


AddAction

1
2
3
4
bool AddAction(
    string manipulationId,
    ActionDefinition action
)

Adds an action definition to the manipulation.

Parameters

NameDescription
manipulationIdManipulation identifier.
actionAction definition to add.

Returns

True if the action was added.


RemoveAction

1
2
3
4
bool RemoveAction(
    string manipulationId,
    string actionId
)

Removes an action definition from the manipulation.

Parameters

NameDescription
manipulationIdManipulation identifier.
actionIdAction identifier.

Returns

True if the action was removed.


SetContextData

1
2
3
4
5
bool SetContextData(
    string manipulationId,
    string key,
    object value
)

Stores custom context data for a manipulation.

Parameters

NameDescription
manipulationIdManipulation identifier.
keyContext key.
valueContext value.

Returns

True if the value was stored.


GetContextData

1
2
3
4
5
T GetContextData<T>(
    string manipulationId,
    string key,
    T defaultValue = default!
)

Reads custom context data for a manipulation.

Type Parameters

NameDescription
TExpected value type.

Parameters

NameDescription
manipulationIdManipulation identifier.
keyContext key.
defaultValueDefault value if the key is absent.

Returns

The stored value if present; otherwise defaultValue.


ApplyPreviewIntent

1
2
3
4
bool ApplyPreviewIntent(
    string manipulationId,
    ManipulationAction action
)

Applies a manipulation intent (rotate/flip) to the current preview transform state. This is a data-only operation; engine layers are responsible for applying the resulting PreviewTransformModel to actual nodes.

Parameters

NameDescription
manipulationIdManipulation identifier.
actionTransform intent (rotate/flip).

Returns

True if the intent was applied; otherwise false.


GetPreviewTransform

1
PreviewTransformModel? GetPreviewTransform(string manipulationId)

Gets the current preview transform model for a manipulation.

Parameters

NameDescription
manipulationIdManipulation identifier.

Returns

The model if the manipulation exists; otherwise null.


GetManipulation

1
ManipulationState? GetManipulation(string manipulationId)

Gets a manipulation by id.

Parameters

NameDescription
manipulationIdManipulation identifier.

Returns

The manipulation state or null.


GetActiveManipulations

1
IEnumerable<ManipulationState> GetActiveManipulations()

Returns all active manipulations.


GetManipulationsByMode

1
IEnumerable<ManipulationState> GetManipulationsByMode(GridMode mode)

Returns active manipulations filtered by mode.

Parameters

NameDescription
modeMode to filter by.

IsManipulationActive

1
bool IsManipulationActive(string manipulationId)

Returns true if the specified manipulation is active.

Parameters

NameDescription
manipulationIdManipulation identifier.

CanStartManipulation

1
2
3
4
bool CanStartManipulation(
    GridMode mode,
    CoreVector2I origin
)

Returns true if a manipulation can be started for the given mode and origin.

Parameters

NameDescription
modeMode to start.
originOrigin position.

ValidateManipulation

1
bool ValidateManipulation(string manipulationId)

Validates the manipulation by id.

Parameters

NameDescription
manipulationIdManipulation identifier.

ValidateManipulationState

1
List<string> ValidateManipulationState(ManipulationState manipulation)

Validates the manipulation state and returns a list of issues.

Parameters

NameDescription
manipulationManipulation state to validate.

Returns

List of validation errors and warnings.


RegisterManipulation

1
void RegisterManipulation(ManipulationState manipulation)

Registers a manipulation state instance for tracking.

Parameters

NameDescription
manipulationManipulation to register.

UnregisterManipulation

1
void UnregisterManipulation(string manipulationId)

Unregisters a manipulation by id.

Parameters

NameDescription
manipulationIdManipulation identifier.

ClearAllManipulations

1
void ClearAllManipulations()

Clears all active manipulations.


Events

ManipulationStarted

1
public abstract event EventHandler<ManipulationStartedEvent>? ManipulationStarted

Raised when a manipulation starts.


ManipulationUpdated

1
public abstract event EventHandler<ManipulationUpdatedEvent>? ManipulationUpdated

Raised when an active manipulation updates its target or affected area.


ManipulationCompleted

1
public abstract event EventHandler<ManipulationCompletedEvent>? ManipulationCompleted

Raised when a manipulation completes successfully.


ManipulationCancelled

1
public abstract event EventHandler<ManipulationCancelledEvent>? ManipulationCancelled

Raised when a manipulation is cancelled.


ManipulationFailed

1
public abstract event EventHandler<ManipulationFailedEvent>? ManipulationFailed

Raised when a manipulation fails (validation error or runtime failure).