Remove dead behavior data query API

This commit is contained in:
Meta Vens 2026-06-14 08:13:47 +01:00
commit 19297f2252
3 changed files with 3 additions and 44 deletions

View file

@ -970,50 +970,6 @@ public abstract class Entity
yield return b;
}
public IEnumerable<T> GetBehaviorData<T>() where T : BehaviorData
{
foreach (var equippedItem in Equipment)
foreach (var behavior in equippedItem.Behaviors)
if (behavior.Data is T b)
yield return b;
}
// public IEnumerable<(T t, Switch s)> GetSwitch<T>() where T : class, IBehavior
// {
// foreach (var equippedItem in Equipment)
// foreach (var group in equippedItem.BehaviorGroups.Values)
// foreach(var behavior in group.Behaviors)
// if (behavior is T t)
// {
// var s = group.GetExposed<Switch>();
// if (s != null) yield return (t, s);
// }
// }
//
// public IEnumerable<(T behavior, Trigger trigger)> GetTrigger<T>() where T : class, IBehavior
// {
// foreach (var equippedItem in Equipment)
// foreach (var group in equippedItem.BehaviorGroups.Values)
// foreach(var behavior in group.Behaviors)
// if (behavior is T t)
// {
// var s = group.GetExposed<Trigger>();
// if (s != null) yield return (t, s);
// }
// }
//
// public IEnumerable<(T behavior, Axis axis)> GetAxis<T>() where T : class, IBehavior
// {
// foreach (var equippedItem in Equipment)
// foreach (var group in equippedItem.BehaviorGroups.Values)
// foreach(var behavior in group.Behaviors)
// if (behavior is T t)
// {
// var s = group.GetExposed<Axis>();
// if (s != null) yield return (t, s);
// }
// }
public virtual void Update(float delta)
{
TargetRange = Target.Value == null ? -1 : length(Position - Target.Value.Position);