Skip to content

Commit

Permalink
Pass profile instead of boolean, this way asset will be reflected at …
Browse files Browse the repository at this point in the history
…runtime
  • Loading branch information
Edvinas01 committed Oct 6, 2023
1 parent 038e69e commit aef3d6d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
using System;
using System.Collections.Generic;
using CHARK.GameManagement.Settings;
using CHARK.GameManagement.Utilities;
using UnityEngine;

namespace CHARK.GameManagement.Entities
{
internal sealed class EntityManager : IEntityManager
{
private readonly List<object> entities = new List<object>();
private readonly bool isVerboseLogging;
private readonly List<object> entities = new();
private readonly IGameManagerSettingsProfile profile;

public IReadOnlyList<object> Entities => entities;

public EntityManager(bool isVerboseLogging = false)
public EntityManager(IGameManagerSettingsProfile profile)
{
this.isVerboseLogging = isVerboseLogging;
this.profile = profile;
}

public bool AddEntity<TEntity>(TEntity entity) where TEntity : class
Expand All @@ -27,7 +27,7 @@ public bool AddEntity<TEntity>(TEntity entity) where TEntity : class
}
#endif

if (isVerboseLogging)
if (profile.IsVerboseLogging)
{
var entityType = entity.GetType();
var entityName = entityType.Name;
Expand Down Expand Up @@ -58,7 +58,7 @@ public bool RemoveEntity<TEntity>(TEntity entity) where TEntity : class
continue;
}

if (isVerboseLogging)
if (profile.IsVerboseLogging)
{
var entityType = entity.GetType();
var entityName = entityType.Name;
Expand Down
2 changes: 1 addition & 1 deletion Packages/com.chark.game-management/Runtime/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ protected virtual IResourceLoader CreateResourceLoader()
protected virtual IEntityManager CreateEntityManager()
{
var profile = Settings.ActiveProfile;
return new EntityManager(profile.IsVerboseLogging);
return new EntityManager(profile);
}

/// <returns>
Expand Down

0 comments on commit aef3d6d

Please sign in to comment.