From bc6d79b088154e2fca56b9c18ee5ea0bf17875f8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 26 Oct 2018 21:59:46 +0200 Subject: model: add mutable MapState (empty for now) --- src/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/index.ts') diff --git a/src/index.ts b/src/index.ts index 5d70727..033e4ea 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,5 @@ -import MapData from './model/MapData'; +import MapData from './model/data/MapData'; +import MapState from './model/state/MapState'; import {loadMap} from './view/MapLoader'; import Renderer from './view/renderer/Renderer'; @@ -13,9 +14,10 @@ window.onload = () => { const xhr = new XMLHttpRequest(); xhr.addEventListener('load', async function() { - const mapDef = new MapData(JSON.parse(this.responseText)); + const mapData = new MapData(JSON.parse(this.responseText)); + const map = new MapState(mapData); - const mapView = await loadMap(renderer, mapDef); + const mapView = await loadMap(renderer, map); mapView.draw(); }); -- cgit v1.2.3