2 ms·
in my finite state machine framework that i built, this is what i do. a state machine is modeled by a class and the states are child classes. for state methods,
by nikofeyn 9y ago
in my finite state machine framework that i built, this is what i do. a state machine is modeled by a class and the states are child classes. for state methods, which are defined by the parent class, i force them to be overridden. then if that method isn’t supported in a certain state, it just does nothing. there is support for sending a return message stating the method sent is not valid in the current state (this is within an actor framework), but i found for the most part doing nothing is fine for most use cases.