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
entityIdint
ConfirmMove(int)
Confirms the move, applying the new position to the source entity.
void ConfirmMove(int entityId)
Parameters
entityIdint
GetActiveMoveGhosts()
Gets all currently active move ghosts.
IReadOnlyList<MoveGhostState> GetActiveMoveGhosts()
Returns
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
sourceEntityIdint
Returns
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
entityIdintsourcePositionCoreVector2I
Returns
TriggerDemolish(int)
Triggers demolition of an entity. Returns true if demolition was triggered successfully.
bool TriggerDemolish(int entityId)
Parameters
entityIdint
Returns
TriggerFlip(int, bool)
Flips the move ghost.
void TriggerFlip(int entityId, bool horizontal)
Parameters
TriggerRotate(int, bool)
Rotates the move ghost.
void TriggerRotate(int entityId, bool clockwise)
Parameters
UpdateMoveTarget(int, CoreVector2I)
Updates the target position for an in-progress move.
void UpdateMoveTarget(int entityId, CoreVector2I targetPosition)
Parameters
entityIdinttargetPositionCoreVector2I
Events
EntityDemolished
Event raised when an entity is demolished. Parameters: (entityId, position, placerKey)
event Action<int, CoreVector2I, string>? EntityDemolished
Event Type
GhostCancelled
Event raised when a ghost is removed without placement. Parameters: (sourceEntityId)
event Action<int>? GhostCancelled
Event Type
GhostCreated
Event raised when a ghost instance is created for move mode. Parameters: (sourceEntityId, ghostEntityId)
event Action<int, int>? GhostCreated
Event Type
MoveConfirmed
Event raised when a move is confirmed and original entity is updated. Parameters: (entityId, position)
event Action<int, CoreVector2I>? MoveConfirmed