

class SimsController extends WindozController {

    constructor(params) {
        super(params)
    }

    async create() {
        const models = {
            sims: new SimsModel('/sims'),
            keyframes: new KeyframesModel('/keyframes')
        }

        this.loadWindow(
            'sims/CreateSimView',
            {
                title: '<i class="icon-new"></i> Create a simulation',
                static: true,
                expanded: false,
                withSettings: false,
                windowStyle: WindozDomContent.boxFromPrefs('sims.createsimview', { x: 'center', y: 'center', w: 600, h: 300 }),
            },
            {
                models: models,
            }
        )
    }

    async manage() {
        const models = {
            sims: new SimsModel('/sims')
        }

        this.loadWindow(
            'sims/ManageSimView',
            {
                title: '<i class="icon-file-play"></i> Play / Pause a simulation',
                static: true,
                expanded: false,
                withSettings: false,
                windowStyle: WindozDomContent.boxFromPrefs('sims.managesimview', { x: 50, y: 50, w: 800, h: 600 }),
            },
            {
                models: models,
            }
        )
    }
}

app.registerClass('SimsController', SimsController)
