Newer
Older
open-logistic-tycoon / engine / kernel / Boot.js
class Boot {
	constructor() {
		console.log("Init Boot");

		this.renderTitle();
		this.includeCSS();
		this.loader = new Loader();
		this.renderer = new Renderer();
	}

	includeCSS() {
		const head = document.querySelector('head');
		for(let cssfile of config.include.css) {
			head.innerHTML = head.innerHTML + `<link type="text/css" rel="stylesheet" href="${cssfile}">`;
		}
	}

	renderTitle() {
		document.querySelector('title').innerHTML = config.title + " " + config.version;
		document.querySelector("#ui .main-menu .game-title").innerHTML = `${config.title} <span class="version">${config.version}</span>`;
	}
}

const kernelInit = (function(){
	this.boot = new Boot();

	return this;
});

let app = {};

document.addEventListener("DOMContentLoaded", e => {
	app.kernel = kernelInit();
	app.game = app.kernel.boot.loader.loadGame();
});