template-systems #41
@ -76,6 +76,7 @@ export class GameModel {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    let parentProductGamesystem: ProductGamesystem;
 | 
					    let parentProductGamesystem: ProductGamesystem;
 | 
				
			||||||
    if(parentGamesystem instanceof SimpleTemplateGamesystem) {
 | 
					    if(parentGamesystem instanceof SimpleTemplateGamesystem) {
 | 
				
			||||||
 | 
					      console.log("Simple Template")
 | 
				
			||||||
      parentProductGamesystem = ProductTemplateCreator.constructTemplateFromSimpleGamesystem(parentGamesystem,  this, templateType!)
 | 
					      parentProductGamesystem = ProductTemplateCreator.constructTemplateFromSimpleGamesystem(parentGamesystem,  this, templateType!)
 | 
				
			||||||
    } else if(parentGamesystem instanceof SimpleGamesystem) {
 | 
					    } else if(parentGamesystem instanceof SimpleGamesystem) {
 | 
				
			||||||
      if(simpleGamesystem instanceof SimpleTemplateGamesystem) {
 | 
					      if(simpleGamesystem instanceof SimpleTemplateGamesystem) {
 | 
				
			||||||
 | 
				
			|||||||
@ -4,6 +4,7 @@ import {ProductTemplateSystem} from "../templates/productGamesystem/ProductTempl
 | 
				
			|||||||
import {Gamesystem} from "../gamesystems/Gamesystem";
 | 
					import {Gamesystem} from "../gamesystems/Gamesystem";
 | 
				
			||||||
import {SimpleTemplateGamesystem} from "../templates/simpleGamesystem/SimpleTemplateGamesystem";
 | 
					import {SimpleTemplateGamesystem} from "../templates/simpleGamesystem/SimpleTemplateGamesystem";
 | 
				
			||||||
import {TemplateType} from "../templates/TemplateType";
 | 
					import {TemplateType} from "../templates/TemplateType";
 | 
				
			||||||
 | 
					import {ProductTemplateCreator} from "../templates/productGamesystem/ProductTemplateCreator";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export class CharacterRelation implements TemplateElement{
 | 
					export class CharacterRelation implements TemplateElement{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -23,6 +24,7 @@ export class CharacterRelation implements TemplateElement{
 | 
				
			|||||||
       templateGamesystem.addChildGamesystem(gamesystem);
 | 
					       templateGamesystem.addChildGamesystem(gamesystem);
 | 
				
			||||||
       templateGamesystem.addChildGamesystem(gamesystem);
 | 
					       templateGamesystem.addChildGamesystem(gamesystem);
 | 
				
			||||||
       this.characterRelationGamesystems.push(templateGamesystem);
 | 
					       this.characterRelationGamesystems.push(templateGamesystem);
 | 
				
			||||||
 | 
					       templateGamesystem.addTemplateElement(this);
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      console.log("Test")
 | 
					      console.log("Test")
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -27,6 +27,8 @@ export class TemplateProductSystemGenerator extends ProductSystemGenerator {
 | 
				
			|||||||
    const productTemplateSystem = this.productGamesystem as ProductTemplateSystem
 | 
					    const productTemplateSystem = this.productGamesystem as ProductTemplateSystem
 | 
				
			||||||
    productTemplateSystem.transitionMap.set(this.templateElement, generationResult.transitions)
 | 
					    productTemplateSystem.transitionMap.set(this.templateElement, generationResult.transitions)
 | 
				
			||||||
    productTemplateSystem.stateMap.set(this.templateElement, generationResult.states)
 | 
					    productTemplateSystem.stateMap.set(this.templateElement, generationResult.states)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    console.log("Test")
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  protected getTransitionConditions(transition: Transition<any>, leftSystem: boolean) {
 | 
					  protected getTransitionConditions(transition: Transition<any>, leftSystem: boolean) {
 | 
				
			||||||
@ -41,7 +43,7 @@ export class TemplateProductSystemGenerator extends ProductSystemGenerator {
 | 
				
			|||||||
    const templateElement = this.determineTemplateElement(leftSystem)!;
 | 
					    const templateElement = this.determineTemplateElement(leftSystem)!;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if(transition instanceof SimpleTemplateTransition && transition.actionMap.has(templateElement)) {
 | 
					    if(transition instanceof SimpleTemplateTransition && transition.actionMap.has(templateElement)) {
 | 
				
			||||||
      return transition.actionMap.get(this.templateElement)!
 | 
					      return transition.actionMap.get(templateElement)!
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      return transition.scriptAccountActions;
 | 
					      return transition.scriptAccountActions;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -51,7 +53,7 @@ export class TemplateProductSystemGenerator extends ProductSystemGenerator {
 | 
				
			|||||||
  protected getStateConditions(state: State<any>, leftSystem: boolean): ScriptAccountCondition[] {
 | 
					  protected getStateConditions(state: State<any>, leftSystem: boolean): ScriptAccountCondition[] {
 | 
				
			||||||
    const templateElement = this.determineTemplateElement(leftSystem)!
 | 
					    const templateElement = this.determineTemplateElement(leftSystem)!
 | 
				
			||||||
    if(state instanceof  SimpleTemplateState && state.conditionMap.has(templateElement)) {
 | 
					    if(state instanceof  SimpleTemplateState && state.conditionMap.has(templateElement)) {
 | 
				
			||||||
      return state.conditionMap.get(this.templateElement)!
 | 
					      return state.conditionMap.get(templateElement)!
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      return state.conditions
 | 
					      return state.conditions
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user