Table of Contents

Interface IComponentHub

Namespace
Cobilas.GodotEngine.Component
Assembly
com.cobilas.godot.icomponent.dll

An interface to transform a Godot.Node object into a pseudo Component.

public interface IComponentHub : IEnumerable<Node>, IEnumerable
Inherited Members

Properties

ComponentsCount

The number of child objects.

int ComponentsCount { get; }

Property Value

int

Returns the number of child objects.

Parent

The parent object.

Node? Parent { get; }

Property Value

Node

Returns the parent object.

ParentComponent

The parent object as IComponentHub.

IComponentHub? ParentComponent { get; }

Property Value

IComponentHub

Returns the parent object as IComponentHub.

Methods

AddComponent(Type?)

Allows you to add a component by specifying its type.

Node? AddComponent(Type? component)

Parameters

component Type

The type to be added.

Returns

Node

Returns the type that was added.

AddComponent<TypeComponent>()

Allows you to add a component by specifying its type.

TypeComponent? AddComponent<TypeComponent>() where TypeComponent : Node

Returns

TypeComponent

Returns the type that was added.

Type Parameters

TypeComponent

The type to be added.

AddComponents(params Type[]?)

Allows you to add multiple components by specifying their type.

void AddComponents(params Type[]? components)

Parameters

components Type[]

The types to be added.

AddNodeComponent(Node?)

Allows you to add a Godot.Node object to the component list.

void AddNodeComponent(Node? component)

Parameters

component Node

The Godot.Node object to add.

AddNodeComponents(params Node[]?)

Allows you to add multiple Godot.Node objects to the component list.

void AddNodeComponents(params Node[]? components)

Parameters

components Node[]

The Godot.Node objects to add.

GetComponent(Type?)

Gets the component by the specified type.

Node? GetComponent(Type? component)

Parameters

component Type

The type to be obtained.

Returns

Node

Returns the component type as node.

GetComponent(Type?, bool)

Gets the component by the specified type.

Node? GetComponent(Type? component, bool recursive)

Parameters

component Type

The type to be obtained.

recursive bool

Allows searching in sub-children.

Returns

Node

Returns the component type as node.

GetComponent<TypeComponent>()

Gets the component by the specified type.

TypeComponent? GetComponent<TypeComponent>() where TypeComponent : Node

Returns

TypeComponent

Returns the component type as node.

Type Parameters

TypeComponent

The type to be obtained.

GetComponent<TypeComponent>(bool)

Gets the component by the specified type.

TypeComponent? GetComponent<TypeComponent>(bool recursive) where TypeComponent : Node

Parameters

recursive bool

Allows searching in sub-children.

Returns

TypeComponent

Returns the component type as node.

Type Parameters

TypeComponent

The type to be obtained.

GetComponents(Type?)

Gets components by the specified type.

Node[]? GetComponents(Type? component)

Parameters

component Type

The type to be obtained.

Returns

Node[]

Returns the component types as a node list.

GetComponents(Type?, bool)

Gets components by the specified type.

Node[]? GetComponents(Type? component, bool recursive)

Parameters

component Type

The type to be obtained.

recursive bool

Allows searching in sub-children.

Returns

Node[]

Returns the component types as a node list.

GetComponents<TypeComponent>()

Gets components by the specified type.

TypeComponent[]? GetComponents<TypeComponent>() where TypeComponent : Node

Returns

TypeComponent[]

Returns the component types as a node list.

Type Parameters

TypeComponent

The type to be obtained.

GetComponents<TypeComponent>(bool)

Gets components by the specified type.

TypeComponent[]? GetComponents<TypeComponent>(bool recursive) where TypeComponent : Node

Parameters

recursive bool

Allows searching in sub-children.

Returns

TypeComponent[]

Returns the component types as a node list.

Type Parameters

TypeComponent

The type to be obtained.

RemoveComponent(Node?)

Allows you to remove a Godot.Node object from the list of components.

bool RemoveComponent(Node? component)

Parameters

component Node

The Godot.Node object to remove.

Returns

bool

Returns true if the operation is successful.

RemoveComponents(params Node[]?)

Allows you to remove several Godot.Node objects from the list of components.

void RemoveComponents(params Node[]? components)

Parameters

components Node[]

The Godot.Node objects to be removed.