mirror of
https://github.com/MaddyThorson/StrawberryBF.git
synced 2024-11-29 17:08:55 +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 abstract class Entity
|
||||||
{
|
{
|
||||||
public Scene Scene { get; private set; }
|
public Scene Scene { get; private set; }
|
||||||
public int Depth;
|
public int Priority;
|
||||||
public bool Active = true;
|
public bool Active = true;
|
||||||
public bool Visible = true;
|
public bool Visible = true;
|
||||||
public bool Collidable = true;
|
public bool Collidable = true;
|
||||||
|
@ -428,7 +428,7 @@ namespace Strawberry
|
||||||
|
|
||||||
static public int Compare(Entity a, Entity b)
|
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
|
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 e as T;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public T First<T>(Point point) where T : Entity
|
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))
|
if (e.Check(point))
|
||||||
return e as T;
|
return e as T;
|
||||||
return null;
|
return null;
|
||||||
|
@ -201,7 +201,7 @@ namespace Strawberry
|
||||||
|
|
||||||
public T First<T>(Rect rect) where T : Entity
|
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))
|
if (e.Check(rect))
|
||||||
return e as T;
|
return e as T;
|
||||||
return null;
|
return null;
|
||||||
|
@ -209,14 +209,14 @@ namespace Strawberry
|
||||||
|
|
||||||
public List<T> All<T>(List<T> into) where T : Entity
|
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);
|
into.Add(e as T);
|
||||||
return into;
|
return into;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<T> All<T>(Point point, List<T> into) where T : Entity
|
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))
|
if (e.Check(point))
|
||||||
into.Add(e as T);
|
into.Add(e as T);
|
||||||
return into;
|
return into;
|
||||||
|
@ -224,7 +224,7 @@ namespace Strawberry
|
||||||
|
|
||||||
public List<T> All<T>(Rect rect, List<T> into) where T : Entity
|
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))
|
if (e.Check(rect))
|
||||||
into.Add(e as T);
|
into.Add(e as T);
|
||||||
return into;
|
return into;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user