CharacterSpecific Templatesystems #36
@ -6,6 +6,7 @@ import {SimpleGamesystem} from "../../game-model/gamesystems/SimpleGamesystem";
|
|||||||
import {StateParser} from "./StateParser";
|
import {StateParser} from "./StateParser";
|
||||||
import {ScriptAccount} from "../../game-model/scriptAccounts/ScriptAccount";
|
import {ScriptAccount} from "../../game-model/scriptAccounts/ScriptAccount";
|
||||||
import {TransitionParser} from "./TransitionParser";
|
import {TransitionParser} from "./TransitionParser";
|
||||||
|
import {SimpleTemplateGamesystem} from "../../game-model/templates/simpleGamesystem/SimpleTemplateGamesystem";
|
||||||
|
|
||||||
export class GamesystemParser {
|
export class GamesystemParser {
|
||||||
|
|
||||||
@ -40,13 +41,21 @@ export class GamesystemParser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parseSimpleGamesystem(gamesystemData: any): SimpleGamesystem {
|
parseSimpleGamesystem(gamesystemData: any): SimpleGamesystem {
|
||||||
const simpleGamesystem = new SimpleGamesystem(gamesystemData.componentName, gamesystemData.componentDescription)
|
let simpleGamesystem
|
||||||
|
if(gamesystemData.templateType != undefined) {
|
||||||
|
simpleGamesystem = new SimpleTemplateGamesystem(gamesystemData.componentName, gamesystemData.componentDescription, gamesystemData.templateType)
|
||||||
|
} else {
|
||||||
|
simpleGamesystem = new SimpleGamesystem(gamesystemData.componentName, gamesystemData.componentDescription)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const stateParser = new StateParser(this.scriptAccounts);
|
const stateParser = new StateParser(this.scriptAccounts);
|
||||||
simpleGamesystem.states = stateParser.parseStates(gamesystemData.states)
|
simpleGamesystem.states = stateParser.parseStates(gamesystemData.states)
|
||||||
|
|
||||||
const transitionParser = new TransitionParser(simpleGamesystem.states, this.scriptAccounts)
|
const transitionParser = new TransitionParser(simpleGamesystem.states, this.scriptAccounts)
|
||||||
simpleGamesystem.transitions = transitionParser.parseTransitions(gamesystemData.transitions)
|
simpleGamesystem.transitions = transitionParser.parseTransitions(gamesystemData.transitions)
|
||||||
|
|
||||||
|
|
||||||
return simpleGamesystem
|
return simpleGamesystem
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user