mapcomplete/Customizations/AllKnownLayouts.ts

71 lines
2.2 KiB
TypeScript
Raw Normal View History

2020-07-31 15:11:44 +00:00
import {LayerDefinition} from "./LayerDefinition";
import {Layout} from "./Layout";
2020-07-31 15:38:03 +00:00
import {All} from "./Layouts/All";
2020-07-31 14:17:16 +00:00
import {CustomLayout} from "../Logic/CustomLayers";
2020-07-31 15:38:03 +00:00
import {Groen} from "./Layouts/Groen";
import Cyclofix from "./Layouts/Cyclofix";
import {StreetWidth} from "./Layouts/StreetWidth";
2020-07-31 15:11:44 +00:00
import {GRB} from "./Layouts/GRB";
import {Artworks} from "./Layouts/Artworks";
2020-07-31 15:38:03 +00:00
import {ClimbingTrees} from "./Layouts/ClimbingTrees";
import {Smoothness} from "./Layouts/Smoothness";
2020-07-31 15:11:44 +00:00
import {MetaMap} from "./Layouts/MetaMap";
2020-07-31 15:38:03 +00:00
import {Natuurpunt} from "./Layouts/Natuurpunt";
2020-07-31 15:11:44 +00:00
import {Bookcases} from "./Layouts/Bookcases";
2020-07-31 16:27:40 +00:00
import {GhostBikes} from "./Layouts/GhostBikes";
import * as bookcases from "../assets/themes/bookcases/Bookcases.json";
import {CustomLayoutFromJSON} from "./JSON/CustomLayoutFromJSON";
2020-07-05 16:59:47 +00:00
export class AllKnownLayouts {
2020-07-31 02:58:58 +00:00
public static allLayers: Map<string, LayerDefinition> = undefined;
public static layoutsList: Layout[] = [
2020-07-31 14:17:16 +00:00
new CustomLayout(),
2020-08-07 18:50:46 +00:00
new Natuurpunt(),
2020-07-31 02:58:58 +00:00
new GRB(),
new Cyclofix(),
2020-07-31 16:27:40 +00:00
new GhostBikes(),
// new Bookcases(),
CustomLayoutFromJSON.LayoutFromJSON(bookcases),
2020-07-31 02:58:58 +00:00
new MetaMap(),
new StreetWidth(),
new ClimbingTrees(),
new Artworks(),
new Smoothness(),
2020-08-07 18:50:46 +00:00
new Groen(),
2020-07-31 15:38:03 +00:00
/*
new Toilets(),
2020-07-31 02:58:58 +00:00
*/
];
2020-07-31 02:58:58 +00:00
public static allSets: Map<string, Layout> = AllKnownLayouts.AllLayouts();
2020-07-24 23:07:02 +00:00
2020-07-31 02:58:58 +00:00
private static AllLayouts(): Map<string, Layout> {
2020-07-24 23:07:02 +00:00
2020-07-24 23:07:02 +00:00
const all = new All();
2020-07-31 02:58:58 +00:00
this.allLayers = new Map<string, LayerDefinition>();
for (const layout of this.layoutsList) {
2020-07-24 23:07:02 +00:00
for (const layer of layout.layers) {
2020-07-31 02:58:58 +00:00
const key = layer.id;
if (this.allLayers[layer.id] !== undefined) {
2020-07-24 23:07:02 +00:00
continue;
}
2020-07-31 02:58:58 +00:00
this.allLayers[layer.id] = layer;
2020-07-24 23:07:02 +00:00
all.layers.push(layer);
}
}
2020-07-20 10:39:43 +00:00
const allSets: Map<string, Layout> = new Map();
2020-07-31 02:58:58 +00:00
for (const layout of this.layoutsList) {
2020-07-05 16:59:47 +00:00
allSets[layout.name] = layout;
}
2020-07-31 02:58:58 +00:00
allSets[all.name] = all;
2020-07-05 16:59:47 +00:00
return allSets;
}
2020-07-05 16:59:47 +00:00
}