Cleaning. Depth => Priority

This commit is contained in:
Matt Thorson 2020-05-31 19:27:26 -07:00
parent afabb58543
commit 67f0bf6e88
2 changed files with 8 additions and 8 deletions

View File

@ -6,7 +6,7 @@ namespace Strawberry
public abstract class Entity
{
public Scene Scene { get; private set; }
public int Depth;
public int Priority;
public bool Active = true;
public bool Visible = true;
public bool Collidable = true;
@ -428,7 +428,7 @@ namespace Strawberry
static public int Compare(Entity a, Entity b)
{
return a.Depth <=> b.Depth;
return a.Priority <=> b.Priority;
}
}
}

View File

@ -186,14 +186,14 @@ namespace Strawberry
public T First<T>() where T : Entity
{
for (var e in entityTracker[typeof(T)])
for (let e in entityTracker[typeof(T)])
return e as T;
return null;
}
public T First<T>(Point point) where T : Entity
{
for (var e in entityTracker[typeof(T)])
for (let e in entityTracker[typeof(T)])
if (e.Check(point))
return e as T;
return null;
@ -201,7 +201,7 @@ namespace Strawberry
public T First<T>(Rect rect) where T : Entity
{
for (var e in entityTracker[typeof(T)])
for (let e in entityTracker[typeof(T)])
if (e.Check(rect))
return e as T;
return null;
@ -209,14 +209,14 @@ namespace Strawberry
public List<T> All<T>(List<T> into) where T : Entity
{
for (var e in entityTracker[typeof(T)])
for (let e in entityTracker[typeof(T)])
into.Add(e as T);
return into;
}
public List<T> All<T>(Point point, List<T> into) where T : Entity
{
for (var e in entityTracker[typeof(T)])
for (let e in entityTracker[typeof(T)])
if (e.Check(point))
into.Add(e as T);
return into;
@ -224,7 +224,7 @@ namespace Strawberry
public List<T> All<T>(Rect rect, List<T> into) where T : Entity
{
for (var e in entityTracker[typeof(T)])
for (let e in entityTracker[typeof(T)])
if (e.Check(rect))
into.Add(e as T);
return into;