Add MeleeEffect and related services for combat interactions

This commit is contained in:
2025-10-30 03:24:44 +01:00
parent bb31c9a39c
commit f65277e6b4
9 changed files with 145 additions and 5 deletions

View File

@@ -5,6 +5,8 @@ using GameCore.Events.Interfaces;
using GameCore.Input.Interfaces;
using GameCore.Interaction;
using GameCore.Logging.Interfaces;
using GameCore.Services;
using GameCore.State;
namespace GameCore.ECS;
@@ -13,18 +15,37 @@ 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, ILogger logger)
public class World
{
private readonly Dictionary<int, List<IComponent>> _componentsByEntityId = new();
private readonly EventBus _eventBus = new();
private readonly List<ISystem> _systems = [];
public readonly IAudioService AudioService;
public readonly SimulationConfig Config = config;
public readonly IInputService InputService = inputService;
public readonly ILogger Logger = logger;
public readonly IWorldQuery WorldQuery = worldQuery;
public readonly SimulationConfig Config;
public readonly IGameStateService GameState;
public readonly IInputService InputService;
public readonly ILogger Logger;
public readonly IParticleService ParticleService;
public readonly IWorldQuery WorldQuery;
private int _nextEntityId;
public World(IInputService inputService,
IWorldQuery worldQuery,
SimulationConfig config,
ILogger logger,
IAudioService audioService,
IParticleService particleService)
{
AudioService = audioService;
Config = config;
InputService = inputService;
Logger = logger;
ParticleService = particleService;
WorldQuery = worldQuery;
GameState = new GameStateService(this);
}
/// <summary>
/// Creates a new, unique entity.
/// </summary>