Class PlacementSceneAdapter
- Namespace
- MoonBark.GridPlacement.Godot.Placement
- Assembly
- MoonBark.GridPlacement.Godot.dll
public sealed class PlacementSceneAdapter : IPlacementView
- Inheritance
-
PlacementSceneAdapter
- Implements
- Inherited Members
Constructors
PlacementSceneAdapter(PlacementContext)
public PlacementSceneAdapter(PlacementContext context)
Parameters
contextPlacementContext
Properties
Context
public PlacementContext Context { get; }
Property Value
ObjectsParent
public Node2D? ObjectsParent { get; set; }
Property Value
- Node2D
Methods
Cleanup()
Cleans up the view and unsubscribes from events.
public void Cleanup()
GetPlacedNode(int)
public Node2D? GetPlacedNode(int entityId)
Parameters
entityIdint
Returns
- Node2D
GetPlacedNodeCount()
public int GetPlacedNodeCount()
Returns
GetPreviewNode(int)
public Node2D? GetPreviewNode(int entityId)
Parameters
entityIdint
Returns
- Node2D
GetPreviewNodeCount()
public int GetPreviewNodeCount()
Returns
HasPlacedNode(int)
public bool HasPlacedNode(int entityId)
Parameters
entityIdint
Returns
HasPreviewNode(int)
public bool HasPreviewNode(int entityId)
Parameters
entityIdint
Returns
Initialize(IEcsBackendEvents)
Initializes the view and subscribes to backend events.
public void Initialize(IEcsBackendEvents events)
Parameters
eventsIEcsBackendEventsThe backend event source to subscribe to.
IsDemolishable(int)
public bool IsDemolishable(int entityId)
Parameters
entityIdint
Returns
SetGridVisible(bool)
Sets the visibility of the grid overlay.
public void SetGridVisible(bool visible)
Parameters
visibleboolTrue to show, false to hide.
SetVisible(bool)
Sets the visibility of the entire placement visualization system.
public void SetVisible(bool visible)
Parameters
visibleboolTrue to show, false to hide.
TryGetEntityId(Node2D, out int)
public bool TryGetEntityId(Node2D node, out int entityId)
Parameters
nodeNode2DentityIdint
Returns
UpdateGridArea(GridRect)
Updates the grid overlay area.
public void UpdateGridArea(GridRect bounds)
Parameters
boundsGridRectThe bounds of the area to show the grid for.
Events
OnPreInstanceAdded
Event fired after the scene node is created but before it is added to the scene tree. Allows external code to configure the node (set properties, attach children, etc.) before _Ready() runs.
public event Action<Node2D>? OnPreInstanceAdded
Event Type
- Action<Node2D>