refactor: Removed IEnumerable<GameObjects> from IGameManager
This commit is contained in:
parent
4d59dcb9ab
commit
cc4068fa2e
@ -5,7 +5,7 @@ namespace Syntriax.Engine.Core.Abstract;
|
||||
/// <summary>
|
||||
/// Represents a game world responsible for managing <see cref="IGameObject"/>s.
|
||||
/// </summary>
|
||||
public interface IGameManager : IEntity, IEnumerable<IGameObject>
|
||||
public interface IGameManager : IEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// Event triggered when <see cref="Update(EngineTime)"/> is called on the <see cref="IGameManager"/>.
|
||||
|
@ -67,7 +67,7 @@ public class BehaviourCollector<T> : IAssignableGameManager, IEnumerable<T>
|
||||
if (GameManager is not null)
|
||||
return false;
|
||||
|
||||
foreach (IGameObject gameObject in gameManager)
|
||||
foreach (IGameObject gameObject in gameManager.GameObjects)
|
||||
OnGameObjectRegistered(gameManager, gameObject);
|
||||
|
||||
gameManager.OnGameObjectRegistered += OnGameObjectRegistered;
|
||||
@ -84,7 +84,7 @@ public class BehaviourCollector<T> : IAssignableGameManager, IEnumerable<T>
|
||||
if (GameManager is null)
|
||||
return false;
|
||||
|
||||
foreach (IGameObject gameObject in GameManager)
|
||||
foreach (IGameObject gameObject in GameManager.GameObjects)
|
||||
OnGameObjectUnregistered(GameManager, gameObject);
|
||||
|
||||
GameManager.OnGameObjectRegistered -= OnGameObjectRegistered;
|
||||
|
@ -191,9 +191,4 @@ public class GameManager : BaseEntity, IGameManager
|
||||
if (sender is IGameObject gameObject)
|
||||
Unregister(gameObject);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
public IEnumerator<IGameObject> GetEnumerator() => _gameObjects.GetEnumerator();
|
||||
IEnumerator IEnumerable.GetEnumerator() => _gameObjects.GetEnumerator();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user