Entity and Component Ended()

This commit is contained in:
Matt Thorson
2020-09-19 22:46:45 -07:00
parent 8747ae1cab
commit 610ef2308f
10 changed files with 194 additions and 39 deletions

View File

@ -250,5 +250,27 @@ namespace Strawberry
return componentTracker[typeof(T)].Count;
}
public List<T> All<T>(List<T> into) where T : Component
{
for (let c in componentTracker[typeof(T)])
into.Add(c as T);
return into;
}
public List<T> All<T>(Point point, List<T> into) where T : Component
{
for (let c in componentTracker[typeof(T)])
if (c.Entity.Check(point))
into.Add(c as T);
return into;
}
public List<T> All<T>(Rect rect, List<T> into) where T : Component
{
for (let c in componentTracker[typeof(T)])
if (c.Entity.Check(rect))
into.Add(c as T);
return into;
}
}
}