33 lines
688 B
TypeScript
33 lines
688 B
TypeScript
import {Transition} from "./Transition";
|
|
|
|
export abstract class State<T extends Transition<any>> {
|
|
stateLabel: string = "";
|
|
stateDescription: string = "";
|
|
incomingTransitions: T[] =[];
|
|
outgoingTransitions: T[] =[];
|
|
|
|
initial: boolean = false;
|
|
|
|
|
|
constructor(stateLabel: string, stateDescription: string) {
|
|
this.stateLabel = stateLabel;
|
|
this.stateDescription = stateDescription;
|
|
}
|
|
|
|
addIncomingTransition(transition: T) {
|
|
this.incomingTransitions.push(transition);
|
|
}
|
|
|
|
addOutgoingTransition(transition: T) {
|
|
this.outgoingTransitions.push(transition);
|
|
}
|
|
|
|
removeIncomingTransition(transition: T) {
|
|
|
|
}
|
|
|
|
removeOutgoingTransition(transition: T) {
|
|
|
|
}
|
|
}
|