class Game{constructor(){console.log("Init Game"),this.initMainMenu()}initMainMenu(){app.kernel.boot.renderer.addRenderFunc("Menu",()=>{var e=document.createElement("BUTTON");return e.classList.add("btn"),e.classList.add("btn-secondary"),e.innerHTML="New Game",e.addEventListener("click",e=>{alert("STARTING NEW GAME")}),{btn:e}}),app.kernel.boot.renderer.addRenderFunc("Menu",()=>{var e=document.createElement("BUTTON");return e.classList.add("btn"),e.classList.add("btn-secondary"),e.innerHTML="Load Game",e.addEventListener("click",e=>{alert("Loading GAME")}),{btn:e}}),app.kernel.boot.renderer.addRenderFunc("Menu",()=>{var e=document.createElement("BUTTON");return e.classList.add("btn"),e.classList.add("btn-secondary"),e.innerHTML="Settings",e.addEventListener("click",e=>{alert("OPEN SETTINGS")}),{btn:e}}),app.kernel.boot.renderer.addRenderFunc("Menu",()=>{var e=document.createElement("BUTTON");return e.classList.add("btn"),e.classList.add("btn-secondary"),e.innerHTML="Exit",e.addEventListener("click",e=>{alert("EXIT")}),{btn:e}}),app.kernel.boot.renderer.renderMenu()}}let config={version:"v0.1 dev",build:1,title:"Open Logistic Tycoon",include:{css:["https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css","game/resources/dist.min.css"]},modules:{square:!0},plugins:{sample:!1}};class Boot{constructor(){console.log("Init Boot"),this.renderTitle(),this.includeCSS(),this.loader=new Loader,this.renderer=new Renderer}includeCSS(){var e,n=document.querySelector("head");for(e of config.include.css)n.innerHTML=n.innerHTML+`<link type="text/css" rel="stylesheet" href="${e}">`}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>`}}let kernelInit=function(){return this.boot=new Boot,this},app={};document.addEventListener("DOMContentLoaded",e=>{app.kernel=kernelInit(),app.game=app.kernel.boot.loader.loadGame()});class Loader{constructor(e){console.log("Init Loader"),this.app=e}loadGame(){return new Game(this.app)}}class Renderer{constructor(){this.rendererFuncs={UITab:[],Menu:[],GameField:[],Settings:[]}}addRenderFunc(e,n){this.rendererFuncs[e].push(n)}renderMenu(){var e,n=document.querySelector("#ui .main-menu").querySelector(".menu-list ul");n.innerHTML="";for(e of this.rendererFuncs.Menu){var t=e(),r=document.createElement("li");r.classList.add("menu-list-item"),r.appendChild(t.btn),n.appendChild(r)}}render(){}} //# sourceMappingURL=app.js.map