Consider SimpleTemplateSystem implementation when calculating leafGamesystems
All checks were successful
E2E Testing / test (push) Successful in 1m34s
All checks were successful
E2E Testing / test (push) Successful in 1m34s
This commit is contained in:
parent
ad9e06e9ec
commit
66697ced00
@ -4,15 +4,17 @@ import {ProductGamesystem} from "../../../project/game-model/gamesystems/Product
|
|||||||
import {State} from "../../../project/game-model/gamesystems/states/State";
|
import {State} from "../../../project/game-model/gamesystems/states/State";
|
||||||
import {SimpleState} from "../../../project/game-model/gamesystems/states/SimpleState";
|
import {SimpleState} from "../../../project/game-model/gamesystems/states/SimpleState";
|
||||||
import {ProductState} from "../../../project/game-model/gamesystems/states/ProductState";
|
import {ProductState} from "../../../project/game-model/gamesystems/states/ProductState";
|
||||||
|
import {SimpleTemplateGamesystem} from "../../../project/game-model/gamesystems/SimpleTemplateGamesystem";
|
||||||
|
|
||||||
export class LeafGamesystemCalculator {
|
export class LeafGamesystemCalculator {
|
||||||
|
|
||||||
static calcLeafGeamesystems(gamesystem: Gamesystem<any, any>) {
|
static calcLeafGeamesystems(gamesystem: Gamesystem<any, any>) {
|
||||||
if(gamesystem instanceof SimpleGamesystem) {
|
if(gamesystem instanceof SimpleGamesystem || gamesystem instanceof SimpleTemplateGamesystem) {
|
||||||
return [gamesystem];
|
return [gamesystem];
|
||||||
} else {
|
} else {
|
||||||
const product_gamesystem = gamesystem as ProductGamesystem;
|
const product_gamesystem = gamesystem as ProductGamesystem;
|
||||||
const leaf_gamesystems: SimpleGamesystem[] = [];
|
const leaf_gamesystems: SimpleGamesystem[] = [];
|
||||||
|
console.log(product_gamesystem)
|
||||||
product_gamesystem.innerGamesystems.forEach(innerGamesystem => {
|
product_gamesystem.innerGamesystems.forEach(innerGamesystem => {
|
||||||
LeafGamesystemCalculator.calcLeafGeamesystems(innerGamesystem).forEach(leafGamesystem => leaf_gamesystems.push(leafGamesystem))
|
LeafGamesystemCalculator.calcLeafGeamesystems(innerGamesystem).forEach(leafGamesystem => leaf_gamesystems.push(leafGamesystem))
|
||||||
})
|
})
|
||||||
|
5
testModel/characters/New Character.json
Normal file
5
testModel/characters/New Character.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"componentName": "New Character",
|
||||||
|
"componentDescription": "",
|
||||||
|
"characterSpecificGamesystems": []
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user