ConceptCreator/e2e/game-model/gamesystems/GamesystemTrainer.ts
Sebastian Böckelmann 75815578dc
Some checks failed
E2E Testing / test (push) Failing after 1m39s
Fix typo in gamemodel import path in test
2024-03-22 08:10:22 +01:00

56 lines
2.3 KiB
TypeScript

import {GameModel} from "../../../src/app/project/game-model/GameModel";
import {SimpleGamesystem} from "../../../src/app/project/game-model/gamesystems/SimpleGamesystem";
import {ProductGamesystem} from "../../../src/app/project/game-model/gamesystems/ProductGamesystem";
export class GamesystemTrainer {
static GAMEMODELNAME: string = "GAMEMODEL";
static SIMPLEGAMESYSTEMNAME: string = "SIMPLE GAMESYSTEM";
static TOP_PRODUCT_GAMESYSTEM_NAME: string = "Top Product Gamesystem"
static SIMPLEGAMESYSTEM2: string = "Simple Gamesystem Leaf 2";
static SIMPLEGAMESYSTEM_LEAF_LEFT: string = "Leaf Gamesystem Left"
static SIMPLEGAMESYSTEM_LEAF_RIGHT: string = "Leaf Gamesystem Right";
static givenEmptyGameModel() {
return new GameModel(GamesystemTrainer.GAMEMODELNAME);
}
static givenGameModelWithSimpleGamesystemOnTopLayer() {
const gameModel = new GameModel(GamesystemTrainer.GAMEMODELNAME);
const gamesytem = new SimpleGamesystem(GamesystemTrainer.SIMPLEGAMESYSTEMNAME);
gameModel.addGamesystem(gamesytem);
return gameModel;
}
static givenGameModelWithProductGamesytemOnTopLayer() {
const gameModel = new GameModel(GamesystemTrainer.GAMEMODELNAME);
const productGamesystem = new ProductGamesystem(this.TOP_PRODUCT_GAMESYSTEM_NAME);
const leaf1 = new SimpleGamesystem(this.SIMPLEGAMESYSTEMNAME);
const leaf2 = new SimpleGamesystem(this.SIMPLEGAMESYSTEM2);
productGamesystem.innerGamesystems.push(leaf1);
productGamesystem.innerGamesystems.push(leaf2);
gameModel.addGamesystem(productGamesystem);
return gameModel;
}
static givenGameModelWithProductGamesystemOnLowerLayer() {
const gameModel = new GameModel(GamesystemTrainer.GAMEMODELNAME);
const top_productGamesystem = new ProductGamesystem(this.TOP_PRODUCT_GAMESYSTEM_NAME);
const leaf1 = new ProductGamesystem(this.SIMPLEGAMESYSTEMNAME);
const leaf2 = new SimpleGamesystem(this.SIMPLEGAMESYSTEM2);
top_productGamesystem.innerGamesystems.push(leaf1);
top_productGamesystem.innerGamesystems.push(leaf2);
gameModel.addGamesystem(top_productGamesystem);
const leaf_1_1 = new SimpleGamesystem(this.SIMPLEGAMESYSTEM_LEAF_LEFT);
leaf1.addChildGamesystem(leaf_1_1);
const leaf_1_2 = new SimpleGamesystem(this.SIMPLEGAMESYSTEM_LEAF_RIGHT);
leaf1.addChildGamesystem(leaf_1_2);
}
}