Table of Contents

Interface IManipulation

Namespace
MoonBark.GridPlacement.Core.Interfaces
Assembly
MoonBark.GridPlacement.Core.dll

Interface for manipulation operations exposed by the manipulation system. Used by the Godot layer to trigger placement operations without depending on ECS types.

All methods that take an EntityStore parameter are internal ECS details hidden behind this interface. The Godot layer uses the overloads without EntityStore, which use the internal store reference.

public interface IManipulation

Methods

CancelMove(int)

Cancels an in-progress move, removing the ghost.

void CancelMove(int entityId)

Parameters

entityId int

ConfirmMove(int)

Confirms the move, applying the new position to the source entity.

void ConfirmMove(int entityId)

Parameters

entityId int

GetActiveMoveGhosts()

Gets all currently active move ghosts.

IReadOnlyList<MoveGhostState> GetActiveMoveGhosts()

Returns

IReadOnlyList<MoveGhostState>

IsMoveInProgress(int)

Checks if a move operation is currently in progress for the given entity. A move is "in progress" when there's a ghost with IsPreviewMode=true for this entity.

bool IsMoveInProgress(int sourceEntityId)

Parameters

sourceEntityId int

Returns

bool

StartMove(int, CoreVector2I)

Starts a move operation for an entity, creating a ghost at its current position. Returns the ghost entity ID, or 0 if move could not be started.

int StartMove(int entityId, CoreVector2I sourcePosition)

Parameters

entityId int
sourcePosition CoreVector2I

Returns

int

TriggerDemolish(int)

Triggers demolition of an entity. Returns true if demolition was triggered successfully.

bool TriggerDemolish(int entityId)

Parameters

entityId int

Returns

bool

TriggerFlip(int, bool)

Flips the move ghost.

void TriggerFlip(int entityId, bool horizontal)

Parameters

entityId int
horizontal bool

TriggerRotate(int, bool)

Rotates the move ghost.

void TriggerRotate(int entityId, bool clockwise)

Parameters

entityId int
clockwise bool

UpdateMoveTarget(int, CoreVector2I)

Updates the target position for an in-progress move.

void UpdateMoveTarget(int entityId, CoreVector2I targetPosition)

Parameters

entityId int
targetPosition CoreVector2I

Events

EntityDemolished

Event raised when an entity is demolished. Parameters: (entityId, position, placerKey)

event Action<int, CoreVector2I, string>? EntityDemolished

Event Type

Action<int, CoreVector2I, string>

GhostCancelled

Event raised when a ghost is removed without placement. Parameters: (sourceEntityId)

event Action<int>? GhostCancelled

Event Type

Action<int>

GhostCreated

Event raised when a ghost instance is created for move mode. Parameters: (sourceEntityId, ghostEntityId)

event Action<int, int>? GhostCreated

Event Type

Action<int, int>

MoveConfirmed

Event raised when a move is confirmed and original entity is updated. Parameters: (entityId, position)

event Action<int, CoreVector2I>? MoveConfirmed

Event Type

Action<int, CoreVector2I>