Add and Remove Conditions from TemplateState
All checks were successful
E2E Testing / test (push) Successful in 1m34s

This commit is contained in:
Sebastian Böckelmann 2024-03-22 17:11:47 +01:00
parent b7ccfe5201
commit 10c3a01f9f
5 changed files with 12 additions and 8 deletions

View File

@ -3,6 +3,6 @@
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title>{{templateGamesystem.referenceGamesystem.componentName}}</mat-panel-title> <mat-panel-title>{{templateGamesystem.referenceGamesystem.componentName}}</mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<app-template-gamesystem-editor [gamesystem]="templateGamesystem"></app-template-gamesystem-editor> <app-template-gamesystem-editor [gamesystem]="templateGamesystem" [scriptAccunts]="scriptAccounts"></app-template-gamesystem-editor>
</mat-expansion-panel> </mat-expansion-panel>
</mat-accordion> </mat-accordion>

View File

@ -4,6 +4,7 @@ import {Gamesystem} from "../../project/game-model/gamesystems/Gamesystem";
import {TemplateGamesystem} from "../../project/game-model/gamesystems/TemplateGamesystem"; import {TemplateGamesystem} from "../../project/game-model/gamesystems/TemplateGamesystem";
import {ProductGamesystem} from "../../project/game-model/gamesystems/ProductGamesystem"; import {ProductGamesystem} from "../../project/game-model/gamesystems/ProductGamesystem";
import {SimpleGamesystem} from "../../project/game-model/gamesystems/SimpleGamesystem"; import {SimpleGamesystem} from "../../project/game-model/gamesystems/SimpleGamesystem";
import {ScriptAccount} from "../../project/game-model/scriptAccounts/ScriptAccount";
@Component({ @Component({
selector: 'app-character-editor', selector: 'app-character-editor',
@ -14,6 +15,7 @@ export class CharacterEditorComponent implements OnInit{
@Input() character: Character | undefined @Input() character: Character | undefined
@Input() referenceGamesystems: Gamesystem<any, any>[] = [] @Input() referenceGamesystems: Gamesystem<any, any>[] = []
@Input() scriptAccounts: ScriptAccount[] = []
templateSimpleGamesystems: TemplateGamesystem[] = [] templateSimpleGamesystems: TemplateGamesystem[] = []
templateProductGamesystems: ProductGamesystem[] = [] templateProductGamesystems: ProductGamesystem[] = []

View File

@ -16,7 +16,8 @@
[scriptAccounts]="gameModel!.scriptAccounts"></app-gamesystem-editor> [scriptAccounts]="gameModel!.scriptAccounts"></app-gamesystem-editor>
<app-character-editor *ngIf="modelComponent.type === ModelComponentType.CHARACTER" <app-character-editor *ngIf="modelComponent.type === ModelComponentType.CHARACTER"
[referenceGamesystems]="loadCharacterSpecificGamesystems()" [referenceGamesystems]="loadCharacterSpecificGamesystems()"
[character]="convertModelComponentToCharacter(modelComponent)"> [character]="convertModelComponentToCharacter(modelComponent)"
[scriptAccounts]="gameModel!.scriptAccounts">
</app-character-editor> </app-character-editor>
</mat-tab> </mat-tab>

View File

@ -1 +1 @@
<app-template-state-editor [templateGamesystem]="gamesystem"></app-template-state-editor> <app-template-state-editor [templateGamesystem]="gamesystem" [scriptAccounts]="scriptAccunts"></app-template-state-editor>

View File

@ -42,10 +42,6 @@ export class TemplateStateEditorComponent {
this.dataSource.filter = filterValue.trim().toLowerCase(); this.dataSource.filter = filterValue.trim().toLowerCase();
} }
onCreateCondition(state: SimpleState, $event: ScriptAccountCondition) {
}
onEditState(state: SimpleState) { onEditState(state: SimpleState) {
if(this.editedElement == null) { if(this.editedElement == null) {
this.editedElement = state this.editedElement = state
@ -59,7 +55,12 @@ export class TemplateStateEditorComponent {
this.dataSource.data = this.templateGamesystem!.templateStates this.dataSource.data = this.templateGamesystem!.templateStates
} }
deleteCondition(state: SimpleState, $event: ScriptAccountCondition) { onCreateCondition(state: SimpleState, condition: ScriptAccountCondition) {
state.addScriptAccountCondition(condition);
}
deleteCondition(state: SimpleState, condition: ScriptAccountCondition) {
state.removeScriptAccountCondition(condition.scriptAccount);
} }
} }