Show / Hide Table of Contents

Interface IParentAwareComponent

Optional interface for components that are attached to something via a components field.

Namespace: GoRogue.Components.ParentAware
Assembly: GoRogue.dll
Syntax
public interface IParentAwareComponent
Remarks

While the implementation of this interface is not required for GoRogue components, when it is used with something implementing IObjectWithComponents, the Parent field is automatically updated when you add or remove this component from a component collection. A component implementing this interface cannot be added to multiple objects at the same time.

Properties

View Source

Parent

The object to which this component is attached, or null if it is not attached.

Declaration
object? Parent { get; set; }
Property Value
Type Description
object
Remarks

Should not be assigned to manually, outside of a custom implementation of IComponentCollection. It is set automatically when added/removed from an object's component collection.

Extension Methods

Utility.Yield<T>(T)
  • View Source
In this article
Back to top Generated by DocFX