template-systems #41

Merged
sebastian merged 30 commits from template-systems into main 2024-04-19 21:10:01 +02:00
3 changed files with 7 additions and 2 deletions
Showing only changes of commit f98ad400e3 - Show all commits

View File

@ -76,6 +76,7 @@ export class GameModel {
let parentProductGamesystem: ProductGamesystem;
if(parentGamesystem instanceof SimpleTemplateGamesystem) {
console.log("Simple Template")
parentProductGamesystem = ProductTemplateCreator.constructTemplateFromSimpleGamesystem(parentGamesystem, this, templateType!)
} else if(parentGamesystem instanceof SimpleGamesystem) {
if(simpleGamesystem instanceof SimpleTemplateGamesystem) {

View File

@ -4,6 +4,7 @@ import {ProductTemplateSystem} from "../templates/productGamesystem/ProductTempl
import {Gamesystem} from "../gamesystems/Gamesystem";
import {SimpleTemplateGamesystem} from "../templates/simpleGamesystem/SimpleTemplateGamesystem";
import {TemplateType} from "../templates/TemplateType";
import {ProductTemplateCreator} from "../templates/productGamesystem/ProductTemplateCreator";
export class CharacterRelation implements TemplateElement{
@ -23,6 +24,7 @@ export class CharacterRelation implements TemplateElement{
templateGamesystem.addChildGamesystem(gamesystem);
templateGamesystem.addChildGamesystem(gamesystem);
this.characterRelationGamesystems.push(templateGamesystem);
templateGamesystem.addTemplateElement(this);
} else {
console.log("Test")
}

View File

@ -27,6 +27,8 @@ export class TemplateProductSystemGenerator extends ProductSystemGenerator {
const productTemplateSystem = this.productGamesystem as ProductTemplateSystem
productTemplateSystem.transitionMap.set(this.templateElement, generationResult.transitions)
productTemplateSystem.stateMap.set(this.templateElement, generationResult.states)
console.log("Test")
}
protected getTransitionConditions(transition: Transition<any>, leftSystem: boolean) {
@ -41,7 +43,7 @@ export class TemplateProductSystemGenerator extends ProductSystemGenerator {
const templateElement = this.determineTemplateElement(leftSystem)!;
if(transition instanceof SimpleTemplateTransition && transition.actionMap.has(templateElement)) {
return transition.actionMap.get(this.templateElement)!
return transition.actionMap.get(templateElement)!
} else {
return transition.scriptAccountActions;
}
@ -51,7 +53,7 @@ export class TemplateProductSystemGenerator extends ProductSystemGenerator {
protected getStateConditions(state: State<any>, leftSystem: boolean): ScriptAccountCondition[] {
const templateElement = this.determineTemplateElement(leftSystem)!
if(state instanceof SimpleTemplateState && state.conditionMap.has(templateElement)) {
return state.conditionMap.get(this.templateElement)!
return state.conditionMap.get(templateElement)!
} else {
return state.conditions
}