Animations improved
This commit is contained in:
parent
c89d93cf24
commit
ad18793543
35 changed files with 430 additions and 465 deletions
|
|
@ -21,9 +21,37 @@ public partial class PoolContainer : Node
|
|||
|
||||
public static PoolContainer Instance {get; private set;}
|
||||
|
||||
public Dictionary<Vector2, IEntity>[] EntityField = { new Dictionary<Vector2, IEntity>(), new Dictionary<Vector2, IEntity>(), new Dictionary<Vector2, IEntity>() };
|
||||
public Dictionary<Vector2, IEntity>[] EntityField = { new(), new(), new() };
|
||||
public override void _Ready()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
public bool TryGetEntity(Vector2 key, out IEntity result, int layer = 1)
|
||||
{
|
||||
if (EntityField[layer].ContainsKey(key))
|
||||
{
|
||||
result = EntityField[layer][key];
|
||||
}
|
||||
else
|
||||
{
|
||||
result = null;
|
||||
}
|
||||
return EntityField[layer].ContainsKey(key)
|
||||
&& EntityField[layer][key] != null;
|
||||
}
|
||||
|
||||
public bool TryGetEntity<T>(Vector2 key, out T result, int layer = 1) where T : class
|
||||
{
|
||||
if (EntityField[layer].ContainsKey(key))
|
||||
{
|
||||
result = EntityField[layer][key] as T;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = null;
|
||||
}
|
||||
return EntityField[layer].ContainsKey(key)
|
||||
&& EntityField[layer][key] != null
|
||||
&& result != null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue