product-template-systems #34
@ -1,4 +1,4 @@
|
||||
<app-product-state-editor [templateElement]="templateElement" [gamesystem]="gamesystem" (onOpenGamesystemEditor)="onOpenGamesystemEditor($event)"></app-product-state-editor>
|
||||
<div id="productStateEditor">
|
||||
<app-product-transition-editor [gamesystem]="gamesystem" (onOpenGamesystem)="onOpenGamesystemEditor($event)"></app-product-transition-editor>
|
||||
<app-product-transition-editor [templateElement]="templateElement" [gamesystem]="gamesystem" (onOpenGamesystem)="onOpenGamesystemEditor($event)"></app-product-transition-editor>
|
||||
</div>
|
||||
|
@ -8,6 +8,8 @@ import {ProductGamesystem} from "../../../../project/game-model/gamesystems/Prod
|
||||
import {SimpleGamesystem} from "../../../../project/game-model/gamesystems/SimpleGamesystem";
|
||||
import {ProductTransition} from "../../../../project/game-model/gamesystems/transitions/ProductTransition";
|
||||
import {ProductState} from "../../../../project/game-model/gamesystems/states/ProductState";
|
||||
import {TemplateElement} from "../../../../project/game-model/templates/TemplateElement";
|
||||
import {ProductTemplateSystem} from "../../../../project/game-model/templates/productGamesystem/ProductTemplateSystem";
|
||||
class DisplayedColumnName {
|
||||
displayedName: string
|
||||
internalName: string
|
||||
@ -34,6 +36,7 @@ export class ProductTransitionEditorComponent implements OnInit{
|
||||
|
||||
@Input() gamesystem: ProductGamesystem | undefined
|
||||
@Output() onOpenGamesystem = new EventEmitter<SimpleGamesystem>();
|
||||
@Input() templateElement: TemplateElement | undefined
|
||||
|
||||
dataSource = new MatTableDataSource<ProductTransition>();
|
||||
displayedColumns: DisplayedColumnName[] = [];
|
||||
@ -52,7 +55,12 @@ export class ProductTransitionEditorComponent implements OnInit{
|
||||
this.columns = this.displayedColumns.map(column => column.internalName)
|
||||
this.columnsToDisplayWithExpand = [...this.columns, 'expand']
|
||||
|
||||
if(this.templateElement == undefined) {
|
||||
this.dataSource.data = this.gamesystem.transitions;
|
||||
} else if(this.gamesystem instanceof ProductTemplateSystem){
|
||||
this.dataSource.data = this.gamesystem!.transitionMap.get(this.templateElement)!
|
||||
}
|
||||
|
||||
this.dataSource.filterPredicate = (data: ProductTransition, filter: string) => {
|
||||
const leaf_starting_states = LeafGamesystemCalculator.calcLeafStates(data.startingState);
|
||||
const leaf_ending_states = LeafGamesystemCalculator.calcLeafStates(data.endingState);
|
||||
|
@ -3,9 +3,48 @@
|
||||
"componentDescription": "",
|
||||
"characterSpecificTemplateSystems": [
|
||||
{
|
||||
"componentName": "Letters",
|
||||
"states": [],
|
||||
"transitions": []
|
||||
"componentName": "TemplateGamesystem",
|
||||
"states": [
|
||||
{
|
||||
"stateLabel": "A",
|
||||
"conditionMap": [
|
||||
{
|
||||
"scriptAccount": "Luftfeuchtigkeit",
|
||||
"minValue": 0,
|
||||
"maxValue": "10"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"stateLabel": "B",
|
||||
"conditionMap": [
|
||||
{
|
||||
"scriptAccount": "New ScriptAccount",
|
||||
"minValue": 0,
|
||||
"maxValue": 100
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"transitions": [
|
||||
{
|
||||
"startingState": "A",
|
||||
"endingState": "B",
|
||||
"conditionMap": [
|
||||
{
|
||||
"scriptAccount": "Temperature",
|
||||
"minValue": 0,
|
||||
"maxValue": 10
|
||||
}
|
||||
],
|
||||
"actionMap": [
|
||||
{
|
||||
"changingValue": 10,
|
||||
"scriptAccount": "Luftfeuchtigkeit"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -37,8 +37,24 @@
|
||||
},
|
||||
{
|
||||
"componentName": "Letters",
|
||||
"states": [],
|
||||
"transitions": []
|
||||
"states": [
|
||||
{
|
||||
"stateLabel": "A",
|
||||
"conditionMap": []
|
||||
},
|
||||
{
|
||||
"stateLabel": "B",
|
||||
"conditionMap": []
|
||||
}
|
||||
],
|
||||
"transitions": [
|
||||
{
|
||||
"startingState": "A",
|
||||
"endingState": "B",
|
||||
"conditionMap": [],
|
||||
"actionMap": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -1,7 +1,27 @@
|
||||
{
|
||||
"componentName": "Letters",
|
||||
"componentDescription": "",
|
||||
"states": [],
|
||||
"transitions": [],
|
||||
"states": [
|
||||
{
|
||||
"initial": false,
|
||||
"conditions": [],
|
||||
"stateLabel": "A",
|
||||
"stateDescription": ""
|
||||
},
|
||||
{
|
||||
"initial": false,
|
||||
"conditions": [],
|
||||
"stateLabel": "B",
|
||||
"stateDescription": ""
|
||||
}
|
||||
],
|
||||
"transitions": [
|
||||
{
|
||||
"scriptAccountActions": [],
|
||||
"scriptAccountConditions": [],
|
||||
"startingState": "A",
|
||||
"endingState": "B"
|
||||
}
|
||||
],
|
||||
"templateType": 0
|
||||
}
|
@ -1,6 +1,26 @@
|
||||
{
|
||||
"componentName": "Numbers",
|
||||
"componentDescription": "",
|
||||
"states": [],
|
||||
"transitions": []
|
||||
"states": [
|
||||
{
|
||||
"initial": false,
|
||||
"conditions": [],
|
||||
"stateLabel": "1",
|
||||
"stateDescription": ""
|
||||
},
|
||||
{
|
||||
"initial": false,
|
||||
"conditions": [],
|
||||
"stateLabel": "2",
|
||||
"stateDescription": ""
|
||||
}
|
||||
],
|
||||
"transitions": [
|
||||
{
|
||||
"scriptAccountActions": [],
|
||||
"scriptAccountConditions": [],
|
||||
"startingState": "1",
|
||||
"endingState": "2"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user