This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
rpgedit/src/app.ts

38 lines
841 B
TypeScript

'use strict';
require('./style.css');
import * as lodash from 'lodash';
_ = lodash;
import MapContext from './control/MapContext';
import MapData from './model/MapData';
import InputHandler from './view/InputHandler';
import * as util from './util';
var relevantKeys = [
InputHandler.Up,
InputHandler.Right,
InputHandler.Down,
InputHandler.Left,
];
var mapContext: MapContext;
window.onload = () => {
var xhr = new XMLHttpRequest();
xhr.onload = function() {
var mapDef = new MapData(JSON.parse(this.responseText));
var inputHandler = new InputHandler(util.numberArrayToMap(relevantKeys));
mapContext = new MapContext(mapDef, inputHandler);
}
xhr.open('GET', 'resources/map/test.json', true);
xhr.send();
};