using System.Text.Json;
using Cthangover.Core.Mods;
namespace Cthangover.Validator
{
///
/// One collection strategy per entity kind, discovered by reflection like
/// every other plugin point in the project (Reflections.FindAndCreate).
/// The JSON entity walker () scans every file
/// once, reads the envelope's "Kind" and delegates the items to the
/// strategy registered for that kind — so adding a new entity type means
/// shipping one class, not editing a switch.
///
/// A strategy fills with declarations
/// and references for its kind. It must not throw on malformed data: missing
/// ids are skipped silently, missing references are reported through the
/// context.
///
public interface IEntityKindStrategy
{
///
/// Entity kind this strategy handles — matches the "Kind" string
/// in the JSON envelope and the used in the
/// graph. Duplicate kinds across strategies are logged and the first
/// discovery wins.
///
string Kind { get; }
///
/// Collects facts for one file of this strategy's kind. The caller has
/// already verified the envelope shape and that the declared kind
/// matches .
///
/// Validation pass state and report sink.
/// Mod that owns the file.
/// Mod-relative file path, used as the declaration/reference source.
/// The envelope's Items array.
void Collect(ValidationContext context, IModInfo mod, string file, JsonElement items);
}
}