Editor/Engine/CompileResult.cs

A small record in the editor tooling for a weapon importer. Stores the path, success flag and error list for one compiled generated file, plus a helper to build a failed result.

using Editor;
using Sandbox;

namespace WeaponImporter.EditorTools.Engine;

/// <summary>Outcome of compiling one generated file.</summary>
public sealed record CompileResult( string Path, bool Success, IReadOnlyList<string> Errors )
{
    public static CompileResult Failed( string path, string error ) => new( path, false, new[] { error } );
}