Refactoring: move the units into the layers instead of the themes

This commit is contained in:
Pieter Vander Vennet 2021-09-13 01:21:47 +02:00
parent 3492b5d403
commit 206aff2c9a
16 changed files with 259 additions and 300 deletions

View file

@ -57,16 +57,16 @@ export default class LayerConfig {
constructor(
json: LayerConfigJson,
units?: Unit[],
context?: string,
official: boolean = true
) {
this.units = units ?? [];
context = context + "." + json.id;
const self = this;
this.id = json.id;
this.allowSplit = json.allowSplit ?? false;
this.name = Translations.T(json.name, context + ".name");
this.units = (json.units ?? []).map(((unitJson, i) => Unit.fromJson(unitJson, `${context}.unit[${i}]`)))
if (json.description !== undefined) {
if (Object.keys(json.description).length === 0) {