28 lines
541 B
TypeScript
28 lines
541 B
TypeScript
import {Transition} from "./Transition";
|
|
|
|
export abstract class State<T extends Transition<any>> {
|
|
|
|
incomingTransitions: T[] =[];
|
|
outgoingTransitions: T[] =[];
|
|
|
|
initial: boolean = false;
|
|
|
|
addIncomingTransition(transition: T) {
|
|
this.incomingTransitions.push(transition);
|
|
}
|
|
|
|
addOutgoingTransition(transition: T) {
|
|
this.outgoingTransitions.push(transition);
|
|
}
|
|
|
|
removeIncomingTransition(transition: T) {
|
|
|
|
}
|
|
|
|
removeOutgoingTransition(transition: T) {
|
|
|
|
}
|
|
|
|
abstract equals(state: State<Transition<any>>): boolean;
|
|
}
|