← Back to Docs
  • index.html
  • Clayground
  • Clayground.Lab
  • ScenarioSet
  • Clayground 2026.7
  • ScenarioSet QML Type

    Declarative collection of scenarios wiring the scenarios()/applyScenario() convention. More...

    Import Statement: import Clayground.Lab

    Properties

    Methods

    Detailed Description

    Delegate the sandbox root's convention functions to this set:

    import Clayground.Lab
    
    ScenarioSet {
        id: scenarioSet
        Scenario { name: "tower"; script: () => buildTower() }
        Scenario { name: "rain"; script: () => spawnRain() }
    }
    function scenarios() { return scenarioSet.names() }
    function applyScenario(n) { scenarioSet.apply(n) }

    Applying a scenario resets the SimClock first (seeded randomness restarts), which is what makes scenario runs reproducible.

    See also Scenario and SimClock.

    Property Documentation

    scenarios : list<Scenario> [default]

    The scenarios (default property).


    Method Documentation

    bool apply(string name)

    Resets the clock and runs the named scenario's script.


    var names()

    Names of all scenarios, for the scenarios() convention.