mirror of
https://github.com/MaddyThorson/StrawberryBF.git
synced 2024-11-25 16:18:56 +08:00
Cleaning. Depth => Priority
This commit is contained in:
parent
afabb58543
commit
67f0bf6e88
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user