ConceptCreator/e2e/game-model/gamesystems/conditions/TransitionConditionTrainer.ts

25 lines
1.1 KiB
TypeScript
Raw Normal View History

import {SimpleState} from "../../../../src/app/game-model/gamesystems/states/SimpleState";
import {SimpleTransition} from "../../../../src/app/game-model/gamesystems/transitions/SimpleTransition";
import {ScriptAccount} from "../../../../src/app/game-model/scriptAccounts/ScriptAccount";
import {ScriptAccountCondition} from "../../../../src/app/game-model/gamesystems/conditions/ScriptAccountCondition";
2024-02-17 19:06:38 +01:00
export class TransitionConditionTrainer {
static withTransitionWithoutConditions() {
const startingState = new SimpleState("StartingState", "");
const endingState = new SimpleState("EndingState", "");
return new SimpleTransition(startingState, endingState);
}
static withTransitionWithCondition() {
const startingState = new SimpleState("StartingState", "");
const endingState = new SimpleState("EndingState", "");
const transition = new SimpleTransition(startingState, endingState);
const scriptAccount = new ScriptAccount("ScriptAccount", "");
transition.scriptAccountConditions.push(ScriptAccountCondition.constructScriptAccountCondition(scriptAccount, 0, 10)!)
return transition;
}
}