Visualize and Edit Actions for Transitions
All checks were successful
E2E Testing / test (push) Successful in 1m31s
All checks were successful
E2E Testing / test (push) Successful in 1m31s
This commit is contained in:
parent
f07cb270f1
commit
b5e3b8ee53
@ -27,7 +27,7 @@
|
|||||||
</mat-drawer>
|
</mat-drawer>
|
||||||
|
|
||||||
<div class="example-sidenav-content">
|
<div class="example-sidenav-content">
|
||||||
<app-editor #editor (onModelNameUpdate)="onModelNameUpdate()"></app-editor>
|
<app-editor #editor (onModelNameUpdate)="onModelNameUpdate()" [gameModel]="gameModel"></app-editor>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</mat-drawer-container>
|
</mat-drawer-container>
|
||||||
|
@ -62,6 +62,9 @@ import {
|
|||||||
} from "./editor/gamesystem-editor/state-editor/product-state-editor/product-state-editor.component";
|
} from "./editor/gamesystem-editor/state-editor/product-state-editor/product-state-editor.component";
|
||||||
import {MatTooltip} from "@angular/material/tooltip";
|
import {MatTooltip} from "@angular/material/tooltip";
|
||||||
import {MatCard, MatCardContent} from "@angular/material/card";
|
import {MatCard, MatCardContent} from "@angular/material/card";
|
||||||
|
import {
|
||||||
|
ScriptaccountActionEditorComponent
|
||||||
|
} from "./editor/gamesystem-editor/transition-editor/scriptaccount-action-editor/scriptaccount-action-editor.component";
|
||||||
|
|
||||||
// AoT requires an exported function for factories
|
// AoT requires an exported function for factories
|
||||||
const httpLoaderFactory = (http: HttpClient): TranslateHttpLoader => new TranslateHttpLoader(http, './assets/i18n/', '.json');
|
const httpLoaderFactory = (http: HttpClient): TranslateHttpLoader => new TranslateHttpLoader(http, './assets/i18n/', '.json');
|
||||||
@ -81,65 +84,66 @@ const httpLoaderFactory = (http: HttpClient): TranslateHttpLoader => new Transl
|
|||||||
SimpleTransitionEditorComponent,
|
SimpleTransitionEditorComponent,
|
||||||
ProductTransitionEditorComponent,
|
ProductTransitionEditorComponent,
|
||||||
ProductStateEditorComponent,
|
ProductStateEditorComponent,
|
||||||
ProductGamesystemEditorComponent
|
ProductGamesystemEditorComponent,
|
||||||
],
|
ScriptaccountActionEditorComponent
|
||||||
imports: [
|
|
||||||
BrowserModule,
|
|
||||||
FormsModule,
|
|
||||||
HttpClientModule,
|
|
||||||
CoreModule,
|
|
||||||
SharedModule,
|
|
||||||
TranslateModule.forRoot({
|
|
||||||
loader: {
|
|
||||||
provide: TranslateLoader,
|
|
||||||
useFactory: httpLoaderFactory,
|
|
||||||
deps: [HttpClient]
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
BrowserAnimationsModule,
|
|
||||||
MatIcon,
|
|
||||||
MatToolbar,
|
|
||||||
MatButton,
|
|
||||||
MatFormField,
|
|
||||||
MatInput,
|
|
||||||
MatDrawerContainer,
|
|
||||||
MatDrawer,
|
|
||||||
MatIconButton,
|
|
||||||
MatMenuTrigger,
|
|
||||||
MatMenu,
|
|
||||||
MatMenuItem,
|
|
||||||
MatListItem,
|
|
||||||
MatActionList,
|
|
||||||
MatTabGroup,
|
|
||||||
MatTab,
|
|
||||||
MatTabLabel,
|
|
||||||
MatLabel,
|
|
||||||
MatFormField,
|
|
||||||
ReactiveFormsModule,
|
|
||||||
MatError,
|
|
||||||
MatDialogTitle,
|
|
||||||
MatDialogContent,
|
|
||||||
MatDialogActions,
|
|
||||||
MatMiniFabButton,
|
|
||||||
MatTreeModule,
|
|
||||||
MatTable,
|
|
||||||
MatColumnDef,
|
|
||||||
MatHeaderCell,
|
|
||||||
MatHeaderCellDef,
|
|
||||||
MatCellDef,
|
|
||||||
MatCell,
|
|
||||||
MatHeaderRow,
|
|
||||||
MatRow,
|
|
||||||
MatHeaderRowDef,
|
|
||||||
MatRowDef,
|
|
||||||
MatCheckbox,
|
|
||||||
MatSelect,
|
|
||||||
MatOption,
|
|
||||||
MatHint,
|
|
||||||
MatTooltip,
|
|
||||||
MatCard,
|
|
||||||
MatCardContent
|
|
||||||
],
|
],
|
||||||
|
imports: [
|
||||||
|
BrowserModule,
|
||||||
|
FormsModule,
|
||||||
|
HttpClientModule,
|
||||||
|
CoreModule,
|
||||||
|
SharedModule,
|
||||||
|
TranslateModule.forRoot({
|
||||||
|
loader: {
|
||||||
|
provide: TranslateLoader,
|
||||||
|
useFactory: httpLoaderFactory,
|
||||||
|
deps: [HttpClient]
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
BrowserAnimationsModule,
|
||||||
|
MatIcon,
|
||||||
|
MatToolbar,
|
||||||
|
MatButton,
|
||||||
|
MatFormField,
|
||||||
|
MatInput,
|
||||||
|
MatDrawerContainer,
|
||||||
|
MatDrawer,
|
||||||
|
MatIconButton,
|
||||||
|
MatMenuTrigger,
|
||||||
|
MatMenu,
|
||||||
|
MatMenuItem,
|
||||||
|
MatListItem,
|
||||||
|
MatActionList,
|
||||||
|
MatTabGroup,
|
||||||
|
MatTab,
|
||||||
|
MatTabLabel,
|
||||||
|
MatLabel,
|
||||||
|
MatFormField,
|
||||||
|
ReactiveFormsModule,
|
||||||
|
MatError,
|
||||||
|
MatDialogTitle,
|
||||||
|
MatDialogContent,
|
||||||
|
MatDialogActions,
|
||||||
|
MatMiniFabButton,
|
||||||
|
MatTreeModule,
|
||||||
|
MatTable,
|
||||||
|
MatColumnDef,
|
||||||
|
MatHeaderCell,
|
||||||
|
MatHeaderCellDef,
|
||||||
|
MatCellDef,
|
||||||
|
MatCell,
|
||||||
|
MatHeaderRow,
|
||||||
|
MatRow,
|
||||||
|
MatHeaderRowDef,
|
||||||
|
MatRowDef,
|
||||||
|
MatCheckbox,
|
||||||
|
MatSelect,
|
||||||
|
MatOption,
|
||||||
|
MatHint,
|
||||||
|
MatTooltip,
|
||||||
|
MatCard,
|
||||||
|
MatCardContent
|
||||||
|
],
|
||||||
providers: [],
|
providers: [],
|
||||||
bootstrap: [AppComponent]
|
bootstrap: [AppComponent]
|
||||||
})
|
})
|
||||||
|
@ -12,7 +12,8 @@
|
|||||||
[scriptAccount]="convertModelComponentToScriptAccount(modelComponent)"></app-script-account-editor>
|
[scriptAccount]="convertModelComponentToScriptAccount(modelComponent)"></app-script-account-editor>
|
||||||
<app-gamesystem-editor *ngIf="modelComponent.type === ModelComponentType.GAMESYTEM"
|
<app-gamesystem-editor *ngIf="modelComponent.type === ModelComponentType.GAMESYTEM"
|
||||||
[gamesystem]="convertModelComponentToGamesystem(modelComponent)"
|
[gamesystem]="convertModelComponentToGamesystem(modelComponent)"
|
||||||
(onOpenGamesystemEditor)="openGameModelComponent($event)"></app-gamesystem-editor>
|
(onOpenGamesystemEditor)="openGameModelComponent($event)"
|
||||||
|
[scriptAccounts]="gameModel!.scriptAccounts"></app-gamesystem-editor>
|
||||||
|
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
</mat-tab-group>
|
</mat-tab-group>
|
||||||
|
@ -16,6 +16,7 @@ export class EditorComponent {
|
|||||||
gameModelComponents: ModelComponent[] = [];
|
gameModelComponents: ModelComponent[] = [];
|
||||||
@Output("onModelNameUpdate") onModelNameUpdateEmitter = new EventEmitter<boolean>();
|
@Output("onModelNameUpdate") onModelNameUpdateEmitter = new EventEmitter<boolean>();
|
||||||
activeTab: number = this.gameModelComponents.length;
|
activeTab: number = this.gameModelComponents.length;
|
||||||
|
@Input() gameModel: GameModel | undefined
|
||||||
|
|
||||||
openGameModelComponent(gameModelComponent: ModelComponent) {
|
openGameModelComponent(gameModelComponent: ModelComponent) {
|
||||||
if(!this.gameModelComponents.includes(gameModelComponent)) {
|
if(!this.gameModelComponents.includes(gameModelComponent)) {
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<app-simple-gamesystem-editor *ngIf="isSimpleGamesystem()" [simpleGamesystem]="convertGamesystemToSimpleGamesystem()"></app-simple-gamesystem-editor>
|
<app-simple-gamesystem-editor *ngIf="isSimpleGamesystem()" [simpleGamesystem]="convertGamesystemToSimpleGamesystem()" [scriptAccunts]="scriptAccounts"></app-simple-gamesystem-editor>
|
||||||
<app-product-gamesystem-editor *ngIf="!isSimpleGamesystem()" [gamesystem]="convertGamesystemToProductGamesystem()"
|
<app-product-gamesystem-editor *ngIf="!isSimpleGamesystem()" [gamesystem]="convertGamesystemToProductGamesystem()"
|
||||||
(onOpenGamesystemEditor)="onOpenGamesystemEditor($event)"></app-product-gamesystem-editor>
|
(onOpenGamesystemEditor)="onOpenGamesystemEditor($event)"></app-product-gamesystem-editor>
|
||||||
|
@ -1,21 +1,27 @@
|
|||||||
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
||||||
import {GameModel} from "../../game-model/GameModel";
|
import {GameModel} from "../../game-model/GameModel";
|
||||||
import {Gamesystem} from "../../game-model/gamesystems/Gamesystem";
|
import {Gamesystem} from "../../game-model/gamesystems/Gamesystem";
|
||||||
import {State} from "../../game-model/gamesystems/states/State";
|
import {State} from "../../game-model/gamesystems/states/State";
|
||||||
import {Transition} from "../../game-model/gamesystems/transitions/Transition";
|
import {Transition} from "../../game-model/gamesystems/transitions/Transition";
|
||||||
import {SimpleGamesystem} from "../../game-model/gamesystems/SimpleGamesystem";
|
import {SimpleGamesystem} from "../../game-model/gamesystems/SimpleGamesystem";
|
||||||
import {ProductGamesystem} from "../../game-model/gamesystems/ProductGamesystem";
|
import {ProductGamesystem} from "../../game-model/gamesystems/ProductGamesystem";
|
||||||
|
import {ScriptAccount} from "../../game-model/scriptAccounts/ScriptAccount";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-gamesystem-editor',
|
selector: 'app-gamesystem-editor',
|
||||||
templateUrl: './gamesystem-editor.component.html',
|
templateUrl: './gamesystem-editor.component.html',
|
||||||
styleUrl: './gamesystem-editor.component.scss'
|
styleUrl: './gamesystem-editor.component.scss'
|
||||||
})
|
})
|
||||||
export class GamesystemEditorComponent {
|
export class GamesystemEditorComponent implements OnInit{
|
||||||
|
|
||||||
@Input() gamesystem: Gamesystem<State<any>, Transition<any>> | undefined
|
@Input() gamesystem: Gamesystem<State<any>, Transition<any>> | undefined
|
||||||
|
@Input() scriptAccounts: ScriptAccount[] = [];
|
||||||
@Output('onOpenGamesystemEditor') openGamesystemEmitter = new EventEmitter<SimpleGamesystem>();
|
@Output('onOpenGamesystemEditor') openGamesystemEmitter = new EventEmitter<SimpleGamesystem>();
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
console.log("GamesystemEditor: ", this.scriptAccounts.length)
|
||||||
|
}
|
||||||
|
|
||||||
isSimpleGamesystem() {
|
isSimpleGamesystem() {
|
||||||
return this.gamesystem instanceof SimpleGamesystem;
|
return this.gamesystem instanceof SimpleGamesystem;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<app-simple-state-editor [states]="simpleGamesystem!.states" [gamesystem]="simpleGamesystem"></app-simple-state-editor>
|
<app-simple-state-editor [states]="simpleGamesystem!.states" [gamesystem]="simpleGamesystem" ></app-simple-state-editor>
|
||||||
<div id="transition-editor">
|
<div id="transition-editor">
|
||||||
<app-simple-transition-editor [gamesystem]="simpleGamesystem"></app-simple-transition-editor>
|
<app-simple-transition-editor [gamesystem]="simpleGamesystem" [scriptAccounts]="scriptAccunts"></app-simple-transition-editor>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import {Component, Input} from '@angular/core';
|
import {Component, Input} from '@angular/core';
|
||||||
import {SimpleGamesystem} from "../../../game-model/gamesystems/SimpleGamesystem";
|
import {SimpleGamesystem} from "../../../game-model/gamesystems/SimpleGamesystem";
|
||||||
import {MatTableDataSource} from "@angular/material/table";
|
import {MatTableDataSource} from "@angular/material/table";
|
||||||
|
import {ScriptAccount} from "../../../game-model/scriptAccounts/ScriptAccount";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-simple-gamesystem-editor',
|
selector: 'app-simple-gamesystem-editor',
|
||||||
@ -10,7 +11,7 @@ import {MatTableDataSource} from "@angular/material/table";
|
|||||||
export class SimpleGamesystemEditorComponent {
|
export class SimpleGamesystemEditorComponent {
|
||||||
|
|
||||||
@Input() simpleGamesystem: SimpleGamesystem | undefined
|
@Input() simpleGamesystem: SimpleGamesystem | undefined
|
||||||
|
@Input() scriptAccunts: ScriptAccount[] = []
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,6 @@ export class ProductTransitionEditorComponent implements OnInit{
|
|||||||
}
|
}
|
||||||
|
|
||||||
const leafStates = LeafGamesystemCalculator.calcLeafStates(state);
|
const leafStates = LeafGamesystemCalculator.calcLeafStates(state);
|
||||||
console.log(leafStates)
|
|
||||||
return leafStates[index];
|
return leafStates[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,45 @@
|
|||||||
|
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8">
|
||||||
|
<ng-container matColumnDef="scriptAccount">
|
||||||
|
<th mat-header-cell *matHeaderCellDef>ScriptAccount</th>
|
||||||
|
<td mat-cell *matCellDef="let action">
|
||||||
|
<span *ngIf="action !== addedAction">{{action.scriptAccount.componentName}}</span>
|
||||||
|
<mat-form-field appearance="fill" class="long-form" *ngIf="action === addedAction">
|
||||||
|
<mat-label>ScriptAccount</mat-label>
|
||||||
|
<mat-select [(ngModel)]="addedAction!.scriptAccount">
|
||||||
|
<mat-option *ngFor="let scriptAccount of scriptAccounts" [value]="scriptAccount">{{scriptAccount.componentName}}</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
</td>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-container matColumnDef="valueChange">
|
||||||
|
<th mat-header-cell *matHeaderCellDef>Value</th>
|
||||||
|
<td mat-cell *matCellDef="let action">
|
||||||
|
<span *ngIf="addedAction !== action && editedAction != action">{{action.changingValue}}</span>
|
||||||
|
<mat-form-field appearance="fill" class="long-form" *ngIf="addedAction === action || editedAction === action">
|
||||||
|
<mat-label>Value</mat-label>
|
||||||
|
<input matInput [(ngModel)]="editedAction!.changingValue" type="number">
|
||||||
|
</mat-form-field>
|
||||||
|
</td>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-container matColumnDef="edit">
|
||||||
|
<th mat-header-cell *matHeaderCellDef></th>
|
||||||
|
<td mat-cell *matCellDef="let action">
|
||||||
|
<button mat-icon-button color="primary" (click)="editAction(action)" [disabled]="addedAction != undefined || editedAction != undefined" *ngIf="action !== editedAction && action !== addedAction"><mat-icon>edit</mat-icon></button>
|
||||||
|
<button mat-icon-button color="primary" *ngIf="action === editedAction || action === addedAction" (click)="finishEditing()"><mat-icon>done</mat-icon></button>
|
||||||
|
</td>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-container matColumnDef="delete">
|
||||||
|
<th mat-header-cell *matHeaderCellDef>
|
||||||
|
<button mat-icon-button (click)="createNewAction()"><mat-icon>add</mat-icon></button>
|
||||||
|
</th>
|
||||||
|
<td mat-cell *matCellDef="let action">
|
||||||
|
<button mat-icon-button color="warn" (click)="deleteAction(action)"><mat-icon>delete</mat-icon></button>
|
||||||
|
</td>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||||
|
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||||
|
</table>
|
@ -0,0 +1,7 @@
|
|||||||
|
table {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.long-form {
|
||||||
|
width: 100%;
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { ScriptaccountActionEditorComponent } from './scriptaccount-action-editor.component';
|
||||||
|
|
||||||
|
describe('ScriptaccountActionEditorComponent', () => {
|
||||||
|
let component: ScriptaccountActionEditorComponent;
|
||||||
|
let fixture: ComponentFixture<ScriptaccountActionEditorComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [ScriptaccountActionEditorComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(ScriptaccountActionEditorComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
@ -0,0 +1,53 @@
|
|||||||
|
import {Component, Input, OnInit} from '@angular/core';
|
||||||
|
import {Transition} from "../../../../game-model/gamesystems/transitions/Transition";
|
||||||
|
import {MatTableDataSource} from "@angular/material/table";
|
||||||
|
import {ScriptAccountAction} from "../../../../game-model/gamesystems/actions/ScriptAccountAction";
|
||||||
|
import {ScriptAccount} from "../../../../game-model/scriptAccounts/ScriptAccount";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-scriptaccount-action-editor',
|
||||||
|
templateUrl: './scriptaccount-action-editor.component.html',
|
||||||
|
styleUrl: './scriptaccount-action-editor.component.scss'
|
||||||
|
})
|
||||||
|
export class ScriptaccountActionEditorComponent implements OnInit{
|
||||||
|
@Input() transition: Transition<any> | undefined
|
||||||
|
@Input() scriptAccounts: ScriptAccount[] = []
|
||||||
|
|
||||||
|
dataSource: MatTableDataSource<ScriptAccountAction> = new MatTableDataSource();
|
||||||
|
displayedColumns: string[] = ['scriptAccount', "valueChange", 'edit', 'delete'];
|
||||||
|
|
||||||
|
editedAction: ScriptAccountAction | undefined
|
||||||
|
addedAction: ScriptAccountAction | undefined
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.dataSource.data = this.transition!.scriptAccountActions.map(action => action);
|
||||||
|
console.log("# ScriptAccounts", this.scriptAccounts.length)
|
||||||
|
}
|
||||||
|
|
||||||
|
editAction(scriptAccountAction: ScriptAccountAction) {
|
||||||
|
this.editedAction = scriptAccountAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
createNewAction() {
|
||||||
|
this.addedAction = new ScriptAccountAction(new ScriptAccount("", ""), 0);
|
||||||
|
this.editedAction = this.addedAction;
|
||||||
|
|
||||||
|
this.dataSource.data = this.dataSource.data.concat(this.addedAction);
|
||||||
|
}
|
||||||
|
|
||||||
|
finishEditing() {
|
||||||
|
if(this.addedAction != undefined && this.addedAction.scriptAccount.componentName !== '') {
|
||||||
|
this.transition?.addScriptAccountAction(this.addedAction)
|
||||||
|
console.log(this.addedAction.scriptAccount)
|
||||||
|
this.dataSource.data = this.transition!.scriptAccountActions;
|
||||||
|
console.log(this.dataSource.data.length, this.transition!.scriptAccountActions.length)
|
||||||
|
this.addedAction = undefined;
|
||||||
|
}
|
||||||
|
this.editedAction = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteAction(action: ScriptAccountAction) {
|
||||||
|
this.transition!.removeScriptAccountAction(action.scriptAccount)
|
||||||
|
this.dataSource.data = this.transition!.scriptAccountActions
|
||||||
|
}
|
||||||
|
}
|
@ -40,7 +40,7 @@
|
|||||||
<td mat-cell *matCellDef="let element" [attr.colspan]="columnsToDisplayWithExpand.length">
|
<td mat-cell *matCellDef="let element" [attr.colspan]="columnsToDisplayWithExpand.length">
|
||||||
<div class="example-element-detail"
|
<div class="example-element-detail"
|
||||||
[@detailExpand]="element == expandedElement ? 'expanded' : 'collapsed'">
|
[@detailExpand]="element == expandedElement ? 'expanded' : 'collapsed'">
|
||||||
<p>Expanded Detail</p>
|
<app-scriptaccount-action-editor [transition]="element" [scriptAccounts]="scriptAccounts"></app-scriptaccount-action-editor>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
@ -1,21 +1,12 @@
|
|||||||
import {Component, Input, OnInit} from '@angular/core';
|
import {Component, Input, OnInit} from '@angular/core';
|
||||||
import {GameModel} from "../../../../game-model/GameModel";
|
|
||||||
import {SimpleGamesystem} from "../../../../game-model/gamesystems/SimpleGamesystem";
|
import {SimpleGamesystem} from "../../../../game-model/gamesystems/SimpleGamesystem";
|
||||||
import {
|
import {
|
||||||
MatCell,
|
|
||||||
MatCellDef,
|
|
||||||
MatColumnDef,
|
|
||||||
MatHeaderCell,
|
|
||||||
MatHeaderCellDef, MatHeaderRow, MatHeaderRowDef, MatRow, MatRowDef,
|
|
||||||
MatTable,
|
|
||||||
MatTableDataSource
|
MatTableDataSource
|
||||||
} from "@angular/material/table";
|
} from "@angular/material/table";
|
||||||
import {SimpleTransition} from "../../../../game-model/gamesystems/transitions/SimpleTransition";
|
import {SimpleTransition} from "../../../../game-model/gamesystems/transitions/SimpleTransition";
|
||||||
import {animate, state, style, transition, trigger} from "@angular/animations";
|
import {animate, state, style, transition, trigger} from "@angular/animations";
|
||||||
import {SimpleState} from "../../../../game-model/gamesystems/states/SimpleState";
|
import {SimpleState} from "../../../../game-model/gamesystems/states/SimpleState";
|
||||||
import {ProductTransition} from "../../../../game-model/gamesystems/transitions/ProductTransition";
|
import {ScriptAccount} from "../../../../game-model/scriptAccounts/ScriptAccount";
|
||||||
import {LeafGamesystemCalculator} from "../../product-gamesystem-editor/LeafGamesystemCalculator";
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-simple-transition-editor',
|
selector: 'app-simple-transition-editor',
|
||||||
templateUrl: './simple-transition-editor.component.html',
|
templateUrl: './simple-transition-editor.component.html',
|
||||||
@ -31,6 +22,7 @@ import {LeafGamesystemCalculator} from "../../product-gamesystem-editor/LeafGame
|
|||||||
export class SimpleTransitionEditorComponent implements OnInit {
|
export class SimpleTransitionEditorComponent implements OnInit {
|
||||||
|
|
||||||
@Input() gamesystem: SimpleGamesystem | undefined
|
@Input() gamesystem: SimpleGamesystem | undefined
|
||||||
|
@Input() scriptAccounts: ScriptAccount[] = []
|
||||||
displayedColumns: string[] = ["starting-state", "ending-state", "edit", "delete"];
|
displayedColumns: string[] = ["starting-state", "ending-state", "edit", "delete"];
|
||||||
dataSource = new MatTableDataSource<SimpleTransition>();
|
dataSource = new MatTableDataSource<SimpleTransition>();
|
||||||
columnsToDisplayWithExpand = [...this.displayedColumns, 'expand'];
|
columnsToDisplayWithExpand = [...this.displayedColumns, 'expand'];
|
||||||
@ -49,6 +41,7 @@ export class SimpleTransitionEditorComponent implements OnInit {
|
|||||||
this.dataSource.filterPredicate = (data: SimpleTransition, filter: string) => {
|
this.dataSource.filterPredicate = (data: SimpleTransition, filter: string) => {
|
||||||
return [data.startingState, data.endingState].some((state) => state.stateLabel.toLowerCase().includes(filter))
|
return [data.startingState, data.endingState].some((state) => state.stateLabel.toLowerCase().includes(filter))
|
||||||
}
|
}
|
||||||
|
console.log("TransitionEditor: ", this.scriptAccounts.length)
|
||||||
}
|
}
|
||||||
|
|
||||||
addTransition() {
|
addTransition() {
|
||||||
|
Loading…
Reference in New Issue
Block a user