Class Owner
- Namespace
- MoonBark.GridPlacement.Core.Domain.State
- Assembly
- MoonBark.GridPlacement.Core.dll
Component that assigns an entity as the active owner on a user state resource.
This node can automatically or manually designate an OwnerRoot (such as a CharacterBody2D, NPC, or other) as the active entity within the system, enabling participation in grid-based logic.
Ported from: godot/addons/grid_building/core/contexts/gb_owner.gd
public class Owner : IOwnerNotifiable, IOwner
- Inheritance
-
Owner
- Implements
- Inherited Members
Constructors
Owner(object?)
Initialize with an optional owner root node.
public Owner(object? ownerRoot = null)
Parameters
ownerRootobjectRoot node that owns this building context (optional)
Properties
OwnerRoot
The root node representing the entity that owns this component.
This can be a player character, AI agent, NPC, or any other node that acts as the owning entity. This node will be assigned as the active entity in the user state.
public object? OwnerRoot { get; set; }
Property Value
Methods
GetRuntimeIssues()
Validates that all required dependencies and properties are properly set. Returns validation issues if dependencies are missing, empty list if valid.
public List<string> GetRuntimeIssues()
Returns
ResolveDependencies(IOwnerContext)
Resolve dependencies from the composition container. Uses the interface type so callers are not forced to rely on the legacy concrete IOwnerContext type.
public void ResolveDependencies(IOwnerContext context)
Parameters
contextIOwnerContextThe owner context to register with
Events
RootChanged
Emits if the root owning node ever changes
public event Action<object?>? RootChanged