Constellations/js/Main.js

24 lines
521 B
JavaScript

import Grid;
import Grid.IO;
import Grid.Color;
import Share;
import Toolbox;
import Mode;
import * as Play from Mode.Play;
import * as Solve from Mode.Solve;
import * as Edit from Mode.Edit;
var size = 8;
Toolbox.init(size);
Mode.init({
play: Play,
solve: Solve,
edit: Edit
});
Grid.init(size, Mode.dispatch);
if(window.location.search.length > 0) {
var urlSearchParameters = new URLSearchParams(window.location.search);
Grid.Color.set(Share.naiveDecode(size, urlSearchParameters.get('game')));
}
Grid.IO.init();