Clash Blueprint Engine API
    Preparing search index...

    Type Alias DomainEvent

    DomainEvent:
        | { building: BuildingInstance; type: "BuildingPlaced" }
        | { from: GridVec; id: BuildingId; to: GridVec; type: "BuildingMoved" }
        | { from: Rotation; id: BuildingId; to: Rotation; type: "BuildingRotated" }
        | { building: BuildingInstance; type: "BuildingDeleted" }
        | { type: "WallAdded"; wall: WallSegment }
        | { type: "WallRemoved"; wall: WallSegment }
        | { from: GridVec; id: WallId; to: GridVec; type: "WallMoved" }
        | { snapshot: VillageSnapshot; type: "LayoutLoaded" }
        | {
            errors: number;
            suggestions: number;
            type: "LayoutValidated";
            warnings: number;
        }
        | { buildings: number; type: "SimulationStarted"; units: number }
        | {
            destructionPercent: number;
            durationSeconds: number;
            stars: number;
            type: "SimulationFinished";
        }

    Facts about what happened, in the past tense. Commands produce events; the ./event-store.ts records them. Events are the substrate for undo history, timeline replay, debugging and (later) real-time collaboration.

    Payloads carry enough information to be self-describing — e.g. a move event records both from and to so it can be inspected or inverted without the surrounding aggregate.