logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Namespace Serenity.AssetPrefetcher.Infrastructure.Editor.Builder

    Classes

    CreatePrefetchPolicyWindow

    Step-by-step window for creating or updating a PrefetchPolicyRegistry asset and the PrefetchPolicyProfile assets it references. The stepped-wizard scaffolding — the header and breadcrumb, the body scroll, the footer and its error gate — comes from Serenity.Global.Infrastructure.Editor.SerenityStepWizardWindow`1; this window declares only its own step table and what the primary action does. It never mutates an asset directly: the window only collects input, PrefetchPolicyCreator does the actual work. The registry's get-or-create resolution goes through Serenity.Global.Infrastructure.Editor.SerenityWizardTargetAsset/Serenity.Global.Infrastructure.Editor.SerenityWizardTargetAssetGui; the profile rows themselves — their lifecycle, drawing, and row-binding validation — live in PrefetchPolicyProfileRowsEditor, this window's own row collaborator.

    Every profile row is its own Serenity.Global.Infrastructure.Editor.SerenityWizardScratchDraft<>, seeded from the registry's own Profiles on a real target change, so reopening the wizard and confirming with zero edits can never revert a real field — e.g. MaxSizeMB — to a template default. A row seeded from an existing profile stays bound to THAT asset, never re-resolved by Id: retyping its Id renames that SAME asset, never re-targets onto whatever a DIFFERENT existing profile the new string happens to match (see CreateFromDrafts(IReadOnlyList<SerenityWizardScratchDraft<PrefetchPolicyProfile>>, string, string, bool, UnboundRowWriteMode)) — including across a domain reload, which Serenity.Global.Infrastructure.Editor.SerenityWizardDraftListLifecycle`1 keeps every row's source bound through. ValidateRowBindings blocks the primary action before that write ever runs when a row's current Id collides with a different existing profile.

    PrefetchPolicyCreator

    Generates (or updates) a PrefetchPolicyRegistry asset and the set of PrefetchPolicyProfile assets it references, from a single description. Mirrors Serenity.GameCamera.Infrastructure.Editor.Builder.GameCameraSettingsCreator: static class, Input/Result DTOs, Validate, Create with created-paths rollback on failure — resolved and folder-provisioned through the shared SettingsAssetAuthoring engine rather than a private copy of its logic. Every validation rule lives in PrefetchPolicyValidator instead — this class keeps only resolution and the actual write path.

    Unlike the registry — a single project-wide asset resolved the same way Serenity.GameCamera.Infrastructure.Settings.UnityGameCameraSettings is — the profiles are a set of N assets. A row built from the flat PrefetchPolicyCreator.Input/PrefetchPolicyCreator.ProfileRow shape (the Create(Input) entry point — headless/programmatic callers) resolves to an existing PrefetchPolicyProfile asset with a matching Id already living in ProfilesFolderPath (updated in place) or a brand-new asset created there — an intentional, documented "update by Id" feature. A row CreatePrefetchPolicyWindow itself seeds from an existing profile is different: it stays bound to THAT SAME asset regardless of what its Id field gets retyped to — see CreateFromDrafts(IReadOnlyList<SerenityWizardScratchDraft<PrefetchPolicyProfile>>, string, string, bool, UnboundRowWriteMode)'s own doc for the identity rule and the finding it closes.

    CreatePrefetchPolicyWindow only collects input and renders results; every asset mutation lives here.

    PrefetchPolicyCreator.Input

    Everything needed to create or update the registry and its profiles.

    PrefetchPolicyCreator.PreviewResult

    A read-only summary of what a Create(Input) call would do, for a Preview step. Never mutates the project.

    PrefetchPolicyCreator.ProfileResult

    Where one profile row resolved to, before or after Create(Input) runs.

    PrefetchPolicyCreator.ProfileRow

    One authored profile row.

    PrefetchPolicyCreator.Result

    Outcome of a Create(Input) call.

    PrefetchPolicyProfileRowsEditor

    The profile-row facet of CreatePrefetchPolicyWindow — row list lifecycle, drawing, and row-binding validation — as its own named collaborator carrying its own serialized state, the same composition Serenity.Global.Infrastructure.Editor.SerenityWizardTargetAsset already uses. Embedded via a single [SerializeField] field on the window instead of the window owning the row list, its serialized mirror, and every row-drawing/validating method directly.

    PrefetchPolicyValidator

    Every rule that decides whether a PrefetchPolicyCreator.Input or a live wizard row is safe to write, resolved read-only against the project's own assets. PrefetchPolicyCreator keeps a thin Validate forwarder for its existing public surface; every other caller (headless tests, the window) reaches this type directly.

    Enums

    CreatePrefetchPolicyWindow.WizardStep

    Public rather than private because C# requires a class's base type to be at least as accessible as the class itself, and this enum is that base type's argument.

    PrefetchPolicyCreator.UnboundRowWriteMode

    How CreateFromDrafts(IReadOnlyList<SerenityWizardScratchDraft<PrefetchPolicyProfile>>, string, string, bool, UnboundRowWriteMode) resolves an UNBOUND row (no Serenity.Global.Infrastructure.Editor.SerenityWizardScratchDraft`1.SourceAsset) whose Id matches an existing on-disk profile. The headless/programmatic Create(Input) entry point documents update-by-Id as an intentional feature, so it keeps UpdateExistingById. CreatePrefetchPolicyWindow has real row bindings and never wants an unbound row to touch an asset no row owns — see CreateOnly.

    In this article
    © 2026 Serenity. All Rights Reserved