namespace ReactorMaintenance.Simulation;

public sealed record LevelState
{
    public static LevelState Create(string name, int width, int height)
    {
        return LevelStateFactory.Create(name, width, height);
    }

    public string Name { get; init; } = "New Reactor";
    public int Width { get; init; } = Balancing.Current.DefaultLevelWidth;
    public int Height { get; init; } = Balancing.Current.DefaultLevelHeight;
    public ECellTerrain[] Terrain { get; init; } = LevelStateFactory.CreateTerrain(Balancing.Current.DefaultLevelWidth, Balancing.Current.DefaultLevelHeight);
    public UndergroundCell[] Fuel { get; init; } = LevelStateFactory.CreateUnderground(Balancing.Current.DefaultLevelWidth, Balancing.Current.DefaultLevelHeight);
    public UndergroundCell[] Coolant { get; init; } = LevelStateFactory.CreateUnderground(Balancing.Current.DefaultLevelWidth, Balancing.Current.DefaultLevelHeight);
    public UndergroundCell[] Electricity { get; init; } = LevelStateFactory.CreateUnderground(Balancing.Current.DefaultLevelWidth, Balancing.Current.DefaultLevelHeight);
    public SurfaceState[] Surface { get; init; } = LevelStateFactory.CreateSurface(Balancing.Current.DefaultLevelWidth, Balancing.Current.DefaultLevelHeight);
    public PropState[] Props { get; init; } = LevelStateFactory.CreateProps(Balancing.Current.DefaultLevelWidth, Balancing.Current.DefaultLevelHeight);
    public IReadOnlyList<DoorState> Doors { get; init; } = Array.Empty<DoorState>();
    public IReadOnlyList<LeakState> Leaks { get; init; } = Array.Empty<LeakState>();
    public IReadOnlyList<ReactorBinding> Reactors { get; init; } = Array.Empty<ReactorBinding>();
    public IReadOnlyList<RuleEventState> RuleEvents { get; init; } = Array.Empty<RuleEventState>();
    public RobotState Robot { get; init; } = new();
    public GlobalState Global { get; init; } = new();
    public IReadOnlyList<Forecast> Forecasts { get; init; } = Array.Empty<Forecast>();
}