Files
RobustToolbox/Robust.Shared/ComponentTrees/IComponentTreeComponent.cs
Leon Friedrich 8ae35e12ee Update ComponentTreeSystem (#6211)
* Allow component trees to be disabled

* forgot

* I'm pretty sure this wasn't working as intended

* also outdated

* reduce branches in QueueTreeUpdate

* remove update hashset

* try fix

* Use Entity<T> and add ray overloads

* Move InRangeUnoccluded to engine

* reduce code duplication

* move _initialized check

* release notes
2025-10-09 17:30:00 +13:00

33 lines
984 B
C#

using Robust.Shared.GameObjects;
using Robust.Shared.Physics;
namespace Robust.Shared.ComponentTrees;
public interface IComponentTreeComponent<TComp> where TComp : Component, IComponentTreeEntry<TComp>
{
public DynamicTree<ComponentTreeEntry<TComp>> Tree { get; set; }
}
/// <summary>
/// Interface that must be implemented by components that can be stored on component trees.
/// </summary>
public interface IComponentTreeEntry<TComp> where TComp : Component
{
/// <summary>
/// The tree that the component is currently stored on.
/// </summary>
public EntityUid? TreeUid { get; set; }
/// <summary>
/// The tree that the component is currently stored on.
/// </summary>
public DynamicTree<ComponentTreeEntry<TComp>>? Tree { get; set; }
/// <summary>
/// Whether the component should currently be added to a tree.
/// </summary>
public bool AddToTree { get; }
public bool TreeUpdateQueued { get; set; }
}