Close we are CLOSE

This commit is contained in:
2026-02-13 22:19:55 -05:00
parent bdd9b7bed8
commit 6cb3c2e53f
5 changed files with 120 additions and 29 deletions

View File

@@ -0,0 +1,39 @@
using System.Collections.Generic;
namespace Awperative;
public abstract partial class Behavior : Docker
{
public Scene Scene => __QueryScene();
private Scene __QueryScene() {
if (Docker is Scene scene) return scene;
if (Docker is Behavior behavior) return behavior.__QueryScene();
return null;
}
public Docker[] Dockers => __QueryDockers();
private Docker[] __QueryDockers()
{
List<Docker> returnValue = [];
Docker currentDocker = Docker;
while (!(currentDocker is Scene))
{
if (currentDocker is Behavior behavior)
{
returnValue.Add(behavior);
currentDocker = behavior.Docker;
}
}
returnValue.Add(currentDocker);
return returnValue.ToArray();
}
public Behavior[] Parents => __QueryParents();
}