Refactor Gamesystems
All checks were successful
E2E Testing / test (push) Successful in 1m33s

This commit is contained in:
Sebastian Böckelmann 2024-02-17 15:38:51 +01:00
parent 77fdd948ca
commit f38626683e
24 changed files with 50 additions and 50 deletions

View File

@ -11,7 +11,7 @@ import {end} from "electron-debug";
import {GamesystemTrainer} from "./GamesystemTrainer";
import {ProductGamesystem} from "../../../src/app/game-model/gamesystems/ProductGamesystem";
import {ProductStateTrainer} from "./ProductStateTrainer";
import {SimpleState} from "../../../../src/app/game-model/gamesystems/SimpleState";
import {SimpleState} from "../../../../src/app/game-model/gamesystems/states/SimpleState";
test.describe('Test Create ProductStates', () => {
test("Adding already existent ProductState", async () => {

View File

@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import {ProductStateTrainer} from "./ProductStateTrainer";
import {ProductState} from "../../../../src/app/game-model/gamesystems/ProductState";
import {ProductState} from "../../../../src/app/game-model/gamesystems/states/ProductState";
import {SimpleGamesystem} from "../../../../src/app/game-model/gamesystems/SimpleGamesystem";
test.describe('Test Create ProductTransitions', () => {
test("Test ProductTransition Creation with invalid inputs", async ()=> {

View File

@ -11,7 +11,7 @@ import {end} from "electron-debug";
import {GamesystemTrainer} from "./GamesystemTrainer";
import {ProductGamesystem} from "../../../src/app/game-model/gamesystems/ProductGamesystem";
import {ProductStateTrainer} from "./ProductStateTrainer";
import {SimpleState} from "../../../../src/app/game-model/gamesystems/SimpleState";
import {SimpleState} from "../../../../src/app/game-model/gamesystems/states/SimpleState";
test.describe('Test Check Equal of Innerstates', () => {
test("Test invalid input for equal checking", async()=> {

View File

@ -11,7 +11,7 @@ import {end} from "electron-debug";
import {GamesystemTrainer} from "./GamesystemTrainer";
import {ProductGamesystem} from "../../../src/app/game-model/gamesystems/ProductGamesystem";
import {ProductStateTrainer} from "./ProductStateTrainer";
import {SimpleState} from "../../../../src/app/game-model/gamesystems/SimpleState";
import {SimpleState} from "../../../../src/app/game-model/gamesystems/states/SimpleState";
import {ProductSystemGenerationTrainer} from "./ProductSystemGenerationTrainer";
test.describe('Test Create ProductStates', () => {

View File

@ -1,7 +1,7 @@
import {ProductGamesystem} from "../../../../src/app/game-model/gamesystems/ProductGamesystem";
import {SimpleGamesystem} from "../../../../src/app/game-model/gamesystems/SimpleGamesystem";
import {ProductState} from "../../../../src/app/game-model/gamesystems/ProductState";
import {ProductTransition} from "../../../../src/app/game-model/gamesystems/ProductTransition";
import {ProductState} from "../../../../src/app/game-model/gamesystems/states/ProductState";
import {ProductTransition} from "../../../../src/app/game-model/gamesystems/transitions/ProductTransition";
export class ProductStateTrainer {
static INNERSTATE_LETTER_1 = "A";

View File

@ -16,7 +16,7 @@ import {ScriptAccount} from "./game-model/scriptAccounts/ScriptAccount";
import {GamescriptOverviewComponent} from "./side-overviews/gamescript-overview/gamescript-overview.component";
import {SimpleGamesystem} from "./game-model/gamesystems/SimpleGamesystem";
import {ProductGamesystem} from "./game-model/gamesystems/ProductGamesystem";
import {ProductState} from "./game-model/gamesystems/ProductState";
import {ProductState} from "./game-model/gamesystems/states/ProductState";
import {LoadModel} from "../../app/LoadModel";
import {LoadedProject} from "../../app/LoadedProject";
import {ProcessLoadedProject} from "./game-model/fs/ProcessLoadedProject";

View File

@ -4,8 +4,8 @@ import {ModelComponent} from "../game-model/ModelComponent";
import {ModelComponentType} from "../game-model/ModelComponentType";
import {ScriptAccount} from "../game-model/scriptAccounts/ScriptAccount";
import {Gamesystem} from "../game-model/gamesystems/Gamesystem";
import {State} from "../game-model/gamesystems/State";
import {Transition} from "../game-model/gamesystems/Transition";
import {State} from "../game-model/gamesystems/states/State";
import {Transition} from "../game-model/gamesystems/transitions/Transition";
@Component({
selector: 'app-editor',

View File

@ -1,8 +1,8 @@
import {Component, EventEmitter, Input, Output} from '@angular/core';
import {GameModel} from "../../game-model/GameModel";
import {Gamesystem} from "../../game-model/gamesystems/Gamesystem";
import {State} from "../../game-model/gamesystems/State";
import {Transition} from "../../game-model/gamesystems/Transition";
import {State} from "../../game-model/gamesystems/states/State";
import {Transition} from "../../game-model/gamesystems/transitions/Transition";
import {SimpleGamesystem} from "../../game-model/gamesystems/SimpleGamesystem";
import {ProductGamesystem} from "../../game-model/gamesystems/ProductGamesystem";

View File

@ -1,9 +1,9 @@
import {Gamesystem} from "../../../game-model/gamesystems/Gamesystem";
import {SimpleGamesystem} from "../../../game-model/gamesystems/SimpleGamesystem";
import {ProductGamesystem} from "../../../game-model/gamesystems/ProductGamesystem";
import {State} from "../../../game-model/gamesystems/State";
import {ProductState} from "../../../game-model/gamesystems/ProductState";
import {SimpleState} from "../../../game-model/gamesystems/SimpleState";
import {State} from "../../../game-model/gamesystems/states/State";
import {ProductState} from "../../../game-model/gamesystems/states/ProductState";
import {SimpleState} from "../../../game-model/gamesystems/states/SimpleState";
export class LeafGamesystemCalculator {

View File

@ -4,11 +4,11 @@ import {SimpleGamesystem} from "../../../../game-model/gamesystems/SimpleGamesys
import {
MatTableDataSource
} from "@angular/material/table";
import {SimpleState} from "../../../../game-model/gamesystems/SimpleState";
import {State} from "../../../../game-model/gamesystems/State";
import {SimpleState} from "../../../../game-model/gamesystems/states/SimpleState";
import {State} from "../../../../game-model/gamesystems/states/State";
import {LeafGamesystemCalculator} from "../../product-gamesystem-editor/LeafGamesystemCalculator";
import {ProductTransition} from "../../../../game-model/gamesystems/ProductTransition";
import {ProductState} from "../../../../game-model/gamesystems/ProductState";
import {ProductTransition} from "../../../../game-model/gamesystems/transitions/ProductTransition";
import {ProductState} from "../../../../game-model/gamesystems/states/ProductState";
@Component({
selector: 'app-product-state-editor',

View File

@ -1,10 +1,10 @@
import {Component, Input, OnInit} from '@angular/core';
import {SimpleState} from "../../../../game-model/gamesystems/SimpleState";
import {SimpleState} from "../../../../game-model/gamesystems/states/SimpleState";
import {MatTableDataSource} from "@angular/material/table";
import {animate, state, style, transition, trigger} from "@angular/animations";
import {MatSnackBar} from "@angular/material/snack-bar";
import {SimpleGamesystem} from "../../../../game-model/gamesystems/SimpleGamesystem";
import {ProductState} from "../../../../game-model/gamesystems/ProductState";
import {ProductState} from "../../../../game-model/gamesystems/states/ProductState";
import {LeafGamesystemCalculator} from "../../product-gamesystem-editor/LeafGamesystemCalculator";
@Component({

View File

@ -5,8 +5,8 @@ import {
MatTableDataSource
} from "@angular/material/table";
import {LeafGamesystemCalculator} from "../../product-gamesystem-editor/LeafGamesystemCalculator";
import {ProductTransition} from "../../../../game-model/gamesystems/ProductTransition";
import {ProductState} from "../../../../game-model/gamesystems/ProductState";
import {ProductTransition} from "../../../../game-model/gamesystems/transitions/ProductTransition";
import {ProductState} from "../../../../game-model/gamesystems/states/ProductState";
class DisplayedColumnName {
displayedName: string
internalName: string

View File

@ -10,10 +10,10 @@ import {
MatTable,
MatTableDataSource
} from "@angular/material/table";
import {SimpleTransition} from "../../../../game-model/gamesystems/SimpleTransition";
import {SimpleTransition} from "../../../../game-model/gamesystems/transitions/SimpleTransition";
import {animate, state, style, transition, trigger} from "@angular/animations";
import {SimpleState} from "../../../../game-model/gamesystems/SimpleState";
import {ProductTransition} from "../../../../game-model/gamesystems/ProductTransition";
import {SimpleState} from "../../../../game-model/gamesystems/states/SimpleState";
import {ProductTransition} from "../../../../game-model/gamesystems/transitions/ProductTransition";
import {LeafGamesystemCalculator} from "../../product-gamesystem-editor/LeafGamesystemCalculator";
@Component({

View File

@ -1,7 +1,7 @@
import {Gamesystem} from "./gamesystems/Gamesystem";
import {ScriptAccount} from "./scriptAccounts/ScriptAccount";
import {Transition} from "./gamesystems/Transition";
import {State} from "./gamesystems/State";
import {Transition} from "./gamesystems/transitions/Transition";
import {State} from "./gamesystems/states/State";
import {ProductGamesystem} from "./gamesystems/ProductGamesystem";
import {SimpleGamesystem} from "./gamesystems/SimpleGamesystem";
import {StorageModel} from "./fs/StorageModel";

View File

@ -1,6 +1,6 @@
import {SimpleGamesystem} from "../../gamesystems/SimpleGamesystem";
import {SimpleState} from "../../gamesystems/SimpleState";
import {SimpleTransition} from "../../gamesystems/SimpleTransition";
import {SimpleState} from "../../gamesystems/states/SimpleState";
import {SimpleTransition} from "../../gamesystems/transitions/SimpleTransition";
export class SimpleGamesystemParser {

View File

@ -1,9 +1,9 @@
import {Gamesystem} from "./Gamesystem";
import {ProductState} from "./ProductState";
import {ProductTransition} from "./ProductTransition";
import {State} from "./State";
import {Transition} from "./Transition";
import {SimpleState} from "./SimpleState";
import {ProductState} from "./states/ProductState";
import {ProductTransition} from "./transitions/ProductTransition";
import {State} from "./states/State";
import {Transition} from "./transitions/Transition";
import {SimpleState} from "./states/SimpleState";
import {SimpleGamesystem} from "./SimpleGamesystem";
import {GameModel} from "../GameModel";
import {ProductStateTrainer} from "../../../../e2e/game-model/gamesystems/productGamesystems/ProductStateTrainer";

View File

@ -1,10 +1,10 @@
import {Gamesystem} from "./Gamesystem";
import {SimpleState} from "./SimpleState";
import {SimpleTransition} from "./SimpleTransition";
import {State} from "./State";
import {Transition} from "./Transition";
import {ProductState} from "./ProductState";
import {ProductTransition} from "./ProductTransition";
import {SimpleState} from "./states/SimpleState";
import {SimpleTransition} from "./transitions/SimpleTransition";
import {State} from "./states/State";
import {Transition} from "./transitions/Transition";
import {ProductState} from "./states/ProductState";
import {ProductTransition} from "./transitions/ProductTransition";
import {ProductGamesystem} from "./ProductGamesystem";
export class SimpleGamesystem extends Gamesystem<SimpleState, SimpleTransition> {

View File

@ -1,7 +1,7 @@
import {ProductTransition} from "./ProductTransition";
import {ProductTransition} from "../transitions/ProductTransition";
import {State} from "./State";
import {SimpleState} from "./SimpleState";
import {Transition} from "./Transition";
import {Transition} from "../transitions/Transition";
export class ProductState extends State<ProductTransition> {
innerStates: State<any>[] = [];

View File

@ -1,6 +1,6 @@
import {State} from "./State";
import {SimpleTransition} from "./SimpleTransition";
import {Transition} from "./Transition";
import {SimpleTransition} from "../transitions/SimpleTransition";
import {Transition} from "../transitions/Transition";
export class SimpleState extends State<SimpleTransition> {
stateLabel: string = "";

View File

@ -1,4 +1,4 @@
import {Transition} from "./Transition";
import {Transition} from "../transitions/Transition";
export abstract class State<T extends Transition<any>> {

View File

@ -1,5 +1,5 @@
import {Transition} from "./Transition";
import {ProductState} from "./ProductState";
import {ProductState} from "../states/ProductState";
export class ProductTransition extends Transition<ProductState> {

View File

@ -1,4 +1,4 @@
import {SimpleState} from "./SimpleState";
import {SimpleState} from "../states/SimpleState";
import {Transition} from "./Transition";
export class SimpleTransition extends Transition<SimpleState> {

View File

@ -1,4 +1,4 @@
import {State} from "./State";
import {State} from "../states/State";
export abstract class Transition<S extends State<any>> {
startingState: S

View File

@ -1,7 +1,7 @@
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {Gamesystem} from "../../game-model/gamesystems/Gamesystem";
import {State} from "../../game-model/gamesystems/State";
import {Transition} from "../../game-model/gamesystems/Transition";
import {State} from "../../game-model/gamesystems/states/State";
import {Transition} from "../../game-model/gamesystems/transitions/Transition";
import {ProductGamesystem} from "../../game-model/gamesystems/ProductGamesystem";
import {FlatTreeControl} from "@angular/cdk/tree";
import {