|
diff --git a/src/app/editor/gamesystem-editor/template-gamesystem-editor/template-transition-editor/template-transition-editor.component.ts b/src/app/editor/gamesystem-editor/template-gamesystem-editor/template-transition-editor/template-transition-editor.component.ts
index 7655553..d075eb3 100644
--- a/src/app/editor/gamesystem-editor/template-gamesystem-editor/template-transition-editor/template-transition-editor.component.ts
+++ b/src/app/editor/gamesystem-editor/template-gamesystem-editor/template-transition-editor/template-transition-editor.component.ts
@@ -24,7 +24,7 @@ export class TemplateTransitionEditorComponent {
@Input() templateGamesystem: TemplateGamesystem | undefined
@Input() scriptAccounts: ScriptAccount[] = []
- displayedColumns: string[] = ["starting-state", "ending-state", "edit", "delete"];
+ displayedColumns: string[] = ["starting-state", "ending-state", "delete"];
dataSource = new MatTableDataSource();
columnsToDisplayWithExpand = [...this.displayedColumns, 'expand'];
expandedElement: SimpleTransition | null = null;
@@ -44,23 +44,18 @@ export class TemplateTransitionEditorComponent {
}
onCreateCondition(transition: SimpleTransition, condition: ScriptAccountCondition) {
-
+ transition.addScriptAccountCondition(condition);
}
deleteCondition(transition: SimpleTransition, condition: ScriptAccountCondition) {
-
+ transition.removeScriptAccountCondition(condition.scriptAccount);
}
deleteTransition(transition: SimpleTransition) {
-
- }
-
- onEditTransition(transition: SimpleTransition) {
- if(this.editedTransition == undefined) {
- this.editedTransition = transition
- } else {
- this.editedTransition = undefined
- }
+ this.templateGamesystem!.templateTransitions = this.templateGamesystem!.templateTransitions.filter(templateTranstion =>
+ templateTranstion.startingState.stateLabel !== transition.startingState.stateLabel &&
+ templateTranstion.endingState.stateLabel !== transition.endingState.stateLabel);
+ this.dataSource.data = this.templateGamesystem!.templateTransitions
}
extractReferencedTransition(transition: SimpleTransition) {
|