issue-15 #21
@ -44,8 +44,7 @@ class GamesystemStorage {
|
|||||||
return unreferencedFiles;
|
return unreferencedFiles;
|
||||||
}
|
}
|
||||||
findReferencedGamesystem(referencedName, gamesystems) {
|
findReferencedGamesystem(referencedName, gamesystems) {
|
||||||
const searchedGamesystem = gamesystems.find(gamesystem => path.basename(gamesystem.fileName) === referencedName);
|
return gamesystems.find(gamesystem => path.basename(gamesystem.fileName) === referencedName);
|
||||||
return searchedGamesystem;
|
|
||||||
}
|
}
|
||||||
storeGamesystem(gamesystem) {
|
storeGamesystem(gamesystem) {
|
||||||
const gamesystemFile = path.join(...gamesystem.fileName.split("/"));
|
const gamesystemFile = path.join(...gamesystem.fileName.split("/"));
|
||||||
|
@ -52,6 +52,7 @@ export class GameModel {
|
|||||||
const parentProductGamesystem = ProductGamesystem.constructFromSimpleGamesystem(parentGamesystem, this);
|
const parentProductGamesystem = ProductGamesystem.constructFromSimpleGamesystem(parentGamesystem, this);
|
||||||
parentProductGamesystem.addChildGamesystem(simpleGamesystem);
|
parentProductGamesystem.addChildGamesystem(simpleGamesystem);
|
||||||
simpleGamesystem.parentGamesystem = parentProductGamesystem;
|
simpleGamesystem.parentGamesystem = parentProductGamesystem;
|
||||||
|
console.log("The parent of my parent is ", parentProductGamesystem.parentGamesystem!.componentName)
|
||||||
} else {
|
} else {
|
||||||
const productParentGamesystem = parentGamesystem as ProductGamesystem;
|
const productParentGamesystem = parentGamesystem as ProductGamesystem;
|
||||||
productParentGamesystem.addChildGamesystem(simpleGamesystem);
|
productParentGamesystem.addChildGamesystem(simpleGamesystem);
|
||||||
|
@ -20,12 +20,14 @@ export class ProductGamesystem extends Gamesystem<ProductState, ProductTransitio
|
|||||||
if(simpleGamesystem.states.length > 0) {
|
if(simpleGamesystem.states.length > 0) {
|
||||||
simpleGamesystem.componentName += "(Child)";
|
simpleGamesystem.componentName += "(Child)";
|
||||||
productGamesystem.addChildGamesystem(simpleGamesystem);
|
productGamesystem.addChildGamesystem(simpleGamesystem);
|
||||||
|
simpleGamesystem.parentGamesystem = productGamesystem
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(parentGamesystem != undefined) {
|
if(parentGamesystem != undefined) {
|
||||||
parentGamesystem.removeChildGamesystem(simpleGamesystem);
|
parentGamesystem.removeChildGamesystem(simpleGamesystem);
|
||||||
parentGamesystem.addChildGamesystem(productGamesystem);
|
parentGamesystem.addChildGamesystem(productGamesystem);
|
||||||
|
productGamesystem.parentGamesystem = parentGamesystem
|
||||||
} else {
|
} else {
|
||||||
gameModel.removeGamesystem(simpleGamesystem);
|
gameModel.removeGamesystem(simpleGamesystem);
|
||||||
gameModel.addGamesystem(productGamesystem);
|
gameModel.addGamesystem(productGamesystem);
|
||||||
|
@ -26,6 +26,9 @@ export class GamesystemSerializer {
|
|||||||
|
|
||||||
private static serializeSimpleGamesystem(simpleGamesystem: SimpleGamesystem): StoreComponent {
|
private static serializeSimpleGamesystem(simpleGamesystem: SimpleGamesystem): StoreComponent {
|
||||||
const fileName = this.computeSimpleGamesystemPath(simpleGamesystem);
|
const fileName = this.computeSimpleGamesystemPath(simpleGamesystem);
|
||||||
|
if(simpleGamesystem.componentName === "Weather(Child)") {
|
||||||
|
console.log(fileName)
|
||||||
|
}
|
||||||
const jsonString = JSON.stringify(simpleGamesystem, (key, value) => {
|
const jsonString = JSON.stringify(simpleGamesystem, (key, value) => {
|
||||||
|
|
||||||
if(this.IGNORED_SIMPLE_ATTRIBUTES.includes(key)) {
|
if(this.IGNORED_SIMPLE_ATTRIBUTES.includes(key)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user