diff --git a/src/app/editor/gamesystem-editor/simple-gamesystem-editor/simple-gamesystem-editor.component.html b/src/app/editor/gamesystem-editor/simple-gamesystem-editor/simple-gamesystem-editor.component.html index e520b73..78dcc5c 100644 --- a/src/app/editor/gamesystem-editor/simple-gamesystem-editor/simple-gamesystem-editor.component.html +++ b/src/app/editor/gamesystem-editor/simple-gamesystem-editor/simple-gamesystem-editor.component.html @@ -1 +1 @@ - + diff --git a/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.html b/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.html index f7c6b5f..e38a1d9 100644 --- a/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.html +++ b/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.html @@ -48,7 +48,7 @@ - + diff --git a/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.ts b/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.ts index 1172f60..bab330a 100644 --- a/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.ts +++ b/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.ts @@ -3,6 +3,7 @@ import {SimpleState} from "../../../../game-model/gamesystems/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"; @Component({ selector: 'app-simple-state-editor', @@ -19,6 +20,7 @@ import {MatSnackBar} from "@angular/material/snack-bar"; export class SimpleStateEditorComponent implements OnInit{ @Input() states: SimpleState[] = []; + @Input() gamesystem: SimpleGamesystem | undefined dataSource = new MatTableDataSource(); displayedColumns = ["name", "initial", "edit", "delete"]; columnsToDisplayWithExpand = [...this.displayedColumns, 'expand']; @@ -57,4 +59,13 @@ export class SimpleStateEditorComponent implements OnInit{ } return false; } + + deleteState(state: SimpleState) { + if(this.gamesystem == undefined || this.gamesystem.parentGamesystem == undefined) { + this.gamesystem?.removeState(state); + this.dataSource.data = this.gamesystem!.states + } else { + + } + } }