/* * Haunted House — composition root. Last file to load. */ (function () { 'use strict'; var Shell = window.XZBTShell; var announcer = new Shell.Announcer({ node: Shell.el('announcement'), idleText: 'The house is quiet \u2014 awaiting instruction.', maxLength: 120 }); var exhibit = new window.HauntedHouseExhibit({ canvas: Shell.el('room-canvas'), announcer: announcer }); var ui = new window.HauntedHouseUI(exhibit, announcer); var core = window.HauntedHouseContract.create(exhibit, ui); var transport = new window.XZBTHostTransport({ core: core, onMessage: function (request, response) { if (response.type === 'hello.result') { Shell.setText(Shell.el('contract-status'), 'host attached'); } } }); exhibit.start(); window.addEventListener('resize', function () { exhibit.resize(); }); window.__exhibit = { core: core, exhibit: exhibit, ui: ui, transport: transport, announcer: announcer }; })();