Table of Contents

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

context PlacementContext

Properties

Context

public PlacementContext Context { get; }

Property Value

PlacementContext

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

entityId int

Returns

Node2D

GetPlacedNodeCount()

public int GetPlacedNodeCount()

Returns

int

GetPreviewNode(int)

public Node2D? GetPreviewNode(int entityId)

Parameters

entityId int

Returns

Node2D

GetPreviewNodeCount()

public int GetPreviewNodeCount()

Returns

int

HasPlacedNode(int)

public bool HasPlacedNode(int entityId)

Parameters

entityId int

Returns

bool

HasPreviewNode(int)

public bool HasPreviewNode(int entityId)

Parameters

entityId int

Returns

bool

Initialize(IEcsBackendEvents)

Initializes the view and subscribes to backend events.

public void Initialize(IEcsBackendEvents events)

Parameters

events IEcsBackendEvents

The backend event source to subscribe to.

IsDemolishable(int)

public bool IsDemolishable(int entityId)

Parameters

entityId int

Returns

bool

SetGridVisible(bool)

Sets the visibility of the grid overlay.

public void SetGridVisible(bool visible)

Parameters

visible bool

True to show, false to hide.

SetVisible(bool)

Sets the visibility of the entire placement visualization system.

public void SetVisible(bool visible)

Parameters

visible bool

True to show, false to hide.

TryGetEntityId(Node2D, out int)

public bool TryGetEntityId(Node2D node, out int entityId)

Parameters

node Node2D
entityId int

Returns

bool

UpdateGridArea(GridRect)

Updates the grid overlay area.

public void UpdateGridArea(GridRect bounds)

Parameters

bounds GridRect

The 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>