product-template-systems #33
@ -4,6 +4,8 @@ import {TemplateElement} from "../templates/TemplateElement";
 | 
			
		||||
import {TemplateGamesystem} from "../templates/TemplateGamesystem";
 | 
			
		||||
import {Gamesystem} from "../gamesystems/Gamesystem";
 | 
			
		||||
import {SimpleTemplateGamesystem} from "../templates/simpleGamesystem/SimpleTemplateGamesystem";
 | 
			
		||||
import {ProductTemplateSystem} from "../templates/productGamesystem/ProductTemplateSystem";
 | 
			
		||||
import {ProductGamesystem} from "../gamesystems/ProductGamesystem";
 | 
			
		||||
 | 
			
		||||
export class Character extends ModelComponent implements TemplateElement {
 | 
			
		||||
 | 
			
		||||
@ -13,10 +15,20 @@ export class Character extends ModelComponent implements TemplateElement {
 | 
			
		||||
    super(componentName, componentDescription, ModelComponentType.CHARACTER);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  addCharacterSpecificSimpleTemplatesystem(gamesystem: SimpleTemplateGamesystem) {
 | 
			
		||||
  addCharacterSpecificSimpleTemplatesystem(gamesystem: Gamesystem<any, any>) {
 | 
			
		||||
    if(!this.isTemplateSystemCharacterSpecific(gamesystem.componentName)) {
 | 
			
		||||
      this.characterSpecificTemplateSystems.push(gamesystem)
 | 
			
		||||
      gamesystem.addTemplateElement(this)
 | 
			
		||||
      if(gamesystem instanceof SimpleTemplateGamesystem) {
 | 
			
		||||
        this.characterSpecificTemplateSystems.push(gamesystem)
 | 
			
		||||
        gamesystem.addTemplateElement(this)
 | 
			
		||||
      } else if(gamesystem instanceof ProductTemplateSystem) {
 | 
			
		||||
        this.characterSpecificTemplateSystems.push(gamesystem)
 | 
			
		||||
        gamesystem.addTemplateElement(this)
 | 
			
		||||
        gamesystem.innerGamesystems.forEach(innerGamesystem => this.addCharacterSpecificSimpleTemplatesystem(innerGamesystem))
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if(gamesystem.parentGamesystem != undefined) {
 | 
			
		||||
        this.addCharacterSpecificSimpleTemplatesystem(gamesystem.parentGamesystem)
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user