Consider SimpleTemplateSystem implementation when calculating leafGamesystems
All checks were successful
E2E Testing / test (push) Successful in 1m34s

This commit is contained in:
Sebastian Böckelmann 2024-04-13 06:55:21 +02:00
parent ad9e06e9ec
commit 66697ced00
2 changed files with 8 additions and 1 deletions

View File

@ -4,15 +4,17 @@ import {ProductGamesystem} from "../../../project/game-model/gamesystems/Product
import {State} from "../../../project/game-model/gamesystems/states/State";
import {SimpleState} from "../../../project/game-model/gamesystems/states/SimpleState";
import {ProductState} from "../../../project/game-model/gamesystems/states/ProductState";
import {SimpleTemplateGamesystem} from "../../../project/game-model/gamesystems/SimpleTemplateGamesystem";
export class LeafGamesystemCalculator {
static calcLeafGeamesystems(gamesystem: Gamesystem<any, any>) {
if(gamesystem instanceof SimpleGamesystem) {
if(gamesystem instanceof SimpleGamesystem || gamesystem instanceof SimpleTemplateGamesystem) {
return [gamesystem];
} else {
const product_gamesystem = gamesystem as ProductGamesystem;
const leaf_gamesystems: SimpleGamesystem[] = [];
console.log(product_gamesystem)
product_gamesystem.innerGamesystems.forEach(innerGamesystem => {
LeafGamesystemCalculator.calcLeafGeamesystems(innerGamesystem).forEach(leafGamesystem => leaf_gamesystems.push(leafGamesystem))
})

View File

@ -0,0 +1,5 @@
{
"componentName": "New Character",
"componentDescription": "",
"characterSpecificGamesystems": []
}