chore: Finalize Don't Set Fields to Null Anymore

This commit is contained in:
2023-11-24 16:37:09 +03:00
parent 44bee2df08
commit 8a8c09f043
6 changed files with 12 additions and 16 deletions

View File

@@ -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;