CharacterSpecific Templatesystems #36
@ -4,6 +4,7 @@ import {SimpleGamesystem} from "../game-model/gamesystems/SimpleGamesystem";
|
|||||||
import {ProductGamesystem} from "../game-model/gamesystems/ProductGamesystem";
|
import {ProductGamesystem} from "../game-model/gamesystems/ProductGamesystem";
|
||||||
import {SerializeConstants} from "./SerializeConstants";
|
import {SerializeConstants} from "./SerializeConstants";
|
||||||
import {ModelComponentType} from "../game-model/ModelComponentType";
|
import {ModelComponentType} from "../game-model/ModelComponentType";
|
||||||
|
import {ProductTemplateSystem} from "../game-model/templates/productGamesystem/ProductTemplateSystem";
|
||||||
|
|
||||||
export class GamesystemSerializer {
|
export class GamesystemSerializer {
|
||||||
|
|
||||||
@ -59,11 +60,23 @@ export class GamesystemSerializer {
|
|||||||
storedChildsystems.forEach(storedChildsystem => storedGamesystems.push(storedChildsystem))
|
storedChildsystems.forEach(storedChildsystem => storedGamesystems.push(storedChildsystem))
|
||||||
})
|
})
|
||||||
|
|
||||||
const jsonString = {
|
let jsonString;
|
||||||
|
if(productGamesystem instanceof ProductTemplateSystem) {
|
||||||
|
jsonString = {
|
||||||
'componentName': productGamesystem.componentName,
|
'componentName': productGamesystem.componentName,
|
||||||
'componentDescription': productGamesystem.componentDescription,
|
'componentDescription': productGamesystem.componentDescription,
|
||||||
'childsystems': innerGamesystemJsonArray
|
'childsystems': innerGamesystemJsonArray,
|
||||||
|
'templateType': productGamesystem.templateType
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
jsonString = {
|
||||||
|
'componentName': productGamesystem.componentName,
|
||||||
|
'componentDescription': productGamesystem.componentDescription,
|
||||||
|
'childsystems': innerGamesystemJsonArray,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const storedProductsystem = new StoreComponent(JSON.stringify(jsonString, null, SerializeConstants.JSON_INDENT), fileName, ModelComponentType.GAMESYTEM)
|
const storedProductsystem = new StoreComponent(JSON.stringify(jsonString, null, SerializeConstants.JSON_INDENT), fileName, ModelComponentType.GAMESYTEM)
|
||||||
storedGamesystems.push(storedProductsystem)
|
storedGamesystems.push(storedProductsystem)
|
||||||
|
Loading…
Reference in New Issue
Block a user