ConceptCreator/e2e/game-model/gamesystems/GamesystemTrainer.ts

56 lines
2.3 KiB
TypeScript
Raw Permalink Normal View History

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";
2024-02-09 20:04:52 +01:00
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";
2024-02-10 10:11:07 +01:00
static SIMPLEGAMESYSTEM_LEAF_LEFT: string = "Leaf Gamesystem Left"
static SIMPLEGAMESYSTEM_LEAF_RIGHT: string = "Leaf Gamesystem Right";
2024-02-09 20:04:52 +01:00
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;
}
2024-02-10 10:11:07 +01:00
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);
}
2024-02-09 20:04:52 +01:00
}