chore: Finalize Don't Set Fields to Null Anymore
This commit is contained in:
@@ -2,6 +2,7 @@ using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
using Syntriax.Engine.Core.Abstract;
|
||||
using Syntriax.Engine.Core.Exceptions;
|
||||
using Syntriax.Engine.Core.Factory;
|
||||
|
||||
namespace Syntriax.Engine.Core;
|
||||
@@ -63,6 +64,8 @@ public class GameManager : IInitialize
|
||||
if (Initialized)
|
||||
return false;
|
||||
|
||||
NotAssignedException.Check(this, StateEnable);
|
||||
|
||||
foreach (var gameObject in GameObjects)
|
||||
gameObject.Initialize();
|
||||
|
||||
@@ -84,7 +87,7 @@ public class GameManager : IInitialize
|
||||
|
||||
public bool Assign(IStateEnable stateEnable)
|
||||
{
|
||||
if (_stateEnable is not null)
|
||||
if (Initialized)
|
||||
return false;
|
||||
|
||||
_stateEnable = stateEnable;
|
||||
|
||||
Reference in New Issue
Block a user