Add logging functionality with ILogger interface and implementations

This commit is contained in:
2025-10-29 01:50:42 +01:00
parent 5d86013239
commit bf15fad9ce
8 changed files with 151 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ using GameCore.ECS.Interfaces;
using GameCore.Events;
using GameCore.Events.Interfaces;
using GameCore.Input.Interfaces;
using GameCore.Logging.Interfaces;
namespace GameCore.ECS;
@@ -11,7 +12,7 @@ namespace GameCore.ECS;
/// It manages all entities, components, and systems, and orchestrates the main game loop.
/// This class is the primary point of interaction for the Engine/Presentation layer.
/// </summary>
public class World(IInputService inputService, IWorldQuery worldQuery, SimulationConfig config)
public class World(IInputService inputService, IWorldQuery worldQuery, SimulationConfig config, ILogger logger)
{
private readonly Dictionary<int, List<IComponent>> _componentsByEntityId = new();
private readonly EventBus _eventBus = new();
@@ -19,6 +20,7 @@ public class World(IInputService inputService, IWorldQuery worldQuery, Simulatio
public readonly SimulationConfig Config = config;
public readonly IInputService InputService = inputService;
public readonly ILogger Logger = logger;
public readonly IWorldQuery WorldQuery = worldQuery;
private int _nextEntityId;