diff --git a/GoRogue/Components/ParentAware/IParentAwareComponent.cs b/GoRogue/Components/ParentAware/IParentAwareComponent.cs
index 152d6a65..d13fceeb 100644
--- a/GoRogue/Components/ParentAware/IParentAwareComponent.cs
+++ b/GoRogue/Components/ParentAware/IParentAwareComponent.cs
@@ -3,7 +3,7 @@
namespace GoRogue.Components.ParentAware
{
///
- /// Optional interface for components that are attached to something implementing .
+ /// Optional interface for components that are attached to something via a components field.
///
///
/// While the implementation of this interface is not required for GoRogue components, when it is used with something
@@ -22,6 +22,6 @@ public interface IParentAwareComponent
/// . It is set automatically when added/removed from an object's
/// component collection.
///
- public IObjectWithComponents? Parent { get; set; }
+ public object? Parent { get; set; }
}
}
diff --git a/GoRogue/Components/ParentAware/ParentAwareComponentBase.cs b/GoRogue/Components/ParentAware/ParentAwareComponentBase.cs
index 3fc33c28..708cd4a7 100644
--- a/GoRogue/Components/ParentAware/ParentAwareComponentBase.cs
+++ b/GoRogue/Components/ParentAware/ParentAwareComponentBase.cs
@@ -10,7 +10,6 @@ namespace GoRogue.Components.ParentAware
/// The type of the parent being passed.
[PublicAPI]
public class ParentAwareComponentRemovedEventArgs : EventArgs
- where T : IObjectWithComponents
{
///
/// The parent from which the object was detached.
@@ -33,6 +32,17 @@ public ParentAwareComponentRemovedEventArgs(T oldParent)
/// type-checking of parent, or requiring that the object it's attached to has or does not have certain types of
/// components.
///
+ ///
+ /// This class may be added as a component to any class that implements , however components
+ /// inheriting from this class will not implicitly fail in any way if it is used with a class that does not implement that interface.
+ /// Certain functions such as do require that their parent implement IObjectWithComponents,
+ /// and in general there is no guarantee that the Parent field gets updated if the parent doesn't implement that interface; however
+ /// you can sync the parent field manually as applicable.
+ ///
+ /// In most cases, the intended usage is to add this as a component to a class that implements ;
+ /// however the option of not doing so and manually syncing the Parent field instead allows this functionality to be tied into other
+ /// component systems as well.
+ ///
[PublicAPI]
public class ParentAwareComponentBase : IParentAwareComponent
{
@@ -44,13 +54,13 @@ public class ParentAwareComponentBase : IParentAwareComponent
///
/// Fires when the component is unattached from an object
///
- public event EventHandler>? Removed;
+ public event EventHandler>? Removed;
- private IObjectWithComponents? _parent;
+ private object? _parent;
///
/// The object the component is attached to.
///
- public virtual IObjectWithComponents? Parent
+ public virtual object? Parent
{
get => _parent;
set
@@ -62,14 +72,13 @@ public virtual IObjectWithComponents? Parent
var oldValue = _parent;
_parent = value;
// Null for oldValue is not possible because value == null AND value != _parent
- Removed?.Invoke(this, new ParentAwareComponentRemovedEventArgs(oldValue!));
+ Removed?.Invoke(this, new ParentAwareComponentRemovedEventArgs