// <auto-generated>
//     Generated from src/lib/publisher/checks.json by
//     scripts/generate-publisher-checks-cs.ts. Do not edit by hand — edit the
//     JSON and regenerate, or the tool and the server will disagree about what
//     a finding means.
// </auto-generated>

using System.Collections.Generic;

namespace Getly.Publisher
{
    public enum GetlySeverity
    {
        /// <summary>The buyer receives something broken. Submission is refused.</summary>
        Error,
        /// <summary>Works, but is worse than it should be. Never blocks.</summary>
        Warning
    }

    public sealed class GetlyCheck
    {
        public readonly string Id;
        public readonly GetlySeverity Severity;
        /// <summary>Stated as the requirement, not the failure.</summary>
        public readonly string Title;
        /// <summary>What it costs the BUYER — the reason a seller should care.</summary>
        public readonly string Why;
        /// <summary>What to actually do about it.</summary>
        public readonly string Fix;

        public GetlyCheck(string id, GetlySeverity severity, string title, string why, string fix)
        {
            Id = id;
            Severity = severity;
            Title = title;
            Why = why;
            Fix = fix;
        }
    }

    public static class GetlyChecks
    {
        public const int Version = 1;
        public const string Tool = "unity";

        public static readonly IReadOnlyList<GetlyCheck> All = new List<GetlyCheck>
        {
            new GetlyCheck(
                "missing_meta",
                GetlySeverity.Error,
                "Every asset needs its .meta file",
                "Unity stores the GUID in the .meta file. Without it the buyer's project regenerates a new GUID, and every prefab, material and scene that pointed at the asset points at nothing.",
                "Include the .meta sibling of every file. If you built the package from a zip rather than Unity's exporter, re-export with Assets → Export Package."),
            new GetlyCheck(
                "empty_package",
                GetlySeverity.Error,
                "The package contains no assets",
                "A buyer would pay and receive nothing.",
                "Select the folder you intend to sell before exporting."),
            new GetlyCheck(
                "missing_script_reference",
                GetlySeverity.Error,
                "A prefab or scene references a script that is not in the package",
                "This is the single most common reason an asset gets refunded: the buyer imports it, opens the demo, and every object shows \"Missing (Mono Script)\".",
                "Include the missing scripts, or remove the components that use them. Unity shows them in the Inspector as \"Missing (Mono Script)\"."),
            new GetlyCheck(
                "absolute_path",
                GetlySeverity.Error,
                "A file contains an absolute path from your machine",
                "A path rooted in your own home folder — /Users/… on a Mac, C:\\Users\\… on Windows — cannot exist on the buyer's computer, so whatever reads it fails silently there and works perfectly for you.",
                "Use Application.dataPath, Resources.Load, or a relative path."),
            new GetlyCheck(
                "editor_code_in_runtime",
                GetlySeverity.Error,
                "Runtime code references the UnityEditor namespace",
                "UnityEditor does not exist in a built player. The buyer's project compiles in the editor and then fails to build — a bug report you will receive instead of a sale.",
                "Move the code into an Editor/ folder, or wrap it in #if UNITY_EDITOR."),
            new GetlyCheck(
                "junk_files",
                GetlySeverity.Error,
                "The package contains system or version-control junk",
                ".DS_Store, Thumbs.db, .git and .idea are not yours to ship and can leak local paths and history.",
                "Delete them before exporting."),
            new GetlyCheck(
                "no_namespace",
                GetlySeverity.Warning,
                "A script has no namespace",
                "Two assets that both define `PlayerController` in the global namespace cannot coexist in one project. The buyer has to rename yours or drop one of you.",
                "Wrap each script in a namespace named after you or the asset."),
            new GetlyCheck(
                "oversized_texture",
                GetlySeverity.Warning,
                "A texture is larger than 2048×2048",
                "Above 2048 the memory cost rises sharply on mobile, and most buyers cannot tell the difference at the sizes an asset is actually used.",
                "Set Max Size to 2048 in the texture importer, or explain in the description why the size is needed."),
            new GetlyCheck(
                "uncompressed_texture",
                GetlySeverity.Warning,
                "A large texture ships uncompressed",
                "An uncompressed 2048 texture is roughly eight times the download and the runtime memory of a compressed one.",
                "Choose a compressed format in the texture importer."),
            new GetlyCheck(
                "package_too_large",
                GetlySeverity.Warning,
                "The package is very large",
                "Large packages are slow to download and slow to import, and buyers abandon both.",
                "Drop source files that the buyer does not need, or split the asset."),
            new GetlyCheck(
                "empty_folder",
                GetlySeverity.Warning,
                "The package contains an empty folder",
                "Empty folders usually mean something was meant to be there and is not.",
                "Remove it, or add the file that belongs in it."),
            new GetlyCheck(
                "no_readme",
                GetlySeverity.Warning,
                "No documentation is included",
                "\"How do I use this?\" is the most common support message an asset receives, and it is answerable once instead of forever.",
                "Add a README with what it is, how to start, and what it does not do."),
            new GetlyCheck(
                "no_demo_scene",
                GetlySeverity.Warning,
                "No demo scene is included",
                "A buyer's first act is to open something and see it work. Without a scene they have to assemble it themselves before knowing whether it was worth buying.",
                "Include a scene that shows the asset in use."),
            new GetlyCheck(
                "not_in_own_folder",
                GetlySeverity.Warning,
                "Assets are not inside a single top-level folder",
                "Importing loose files scatters them through the buyer's project, and removing your asset later becomes a manual hunt.",
                "Put everything under Assets/YourName/AssetName/."),
            new GetlyCheck(
                "no_license_file",
                GetlySeverity.Warning,
                "No licence file is included",
                "The buyer needs to know what they may do with this, and a licence inside the package survives long after the listing page is closed.",
                "Add a LICENSE or LICENSE.txt stating what the buyer may and may not do."),
            new GetlyCheck(
                "third_party_binary",
                GetlySeverity.Warning,
                "The package contains a compiled library",
                "A .dll a buyer did not expect is both a licensing question and a security one, and some buyers refuse packages containing any.",
                "If it is yours, say so in the README. If it is someone else's, confirm you may redistribute it."),
        };

        private static Dictionary<string, GetlyCheck> _byId;

        public static GetlyCheck Get(string id)
        {
            if (_byId == null)
            {
                _byId = new Dictionary<string, GetlyCheck>();
                foreach (var check in All) _byId[check.Id] = check;
            }
            return _byId.TryGetValue(id, out var found) ? found : null;
        }
    }
}
