Files
XZBT-NGN/test-fixtures/reference-exhibits/haunted-house/boot.js
T
2026-09-14 07:57:18 -07:00

45 lines
1012 B
JavaScript

/*
* 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
};
})();