Print at Dec 20, 2025, 9:30:25 AM

Posted by Cardinal at Jul 27, 2011, 9:51:48 AM
Re: A quick question about ControllerState subclasses
Is it because you want to prevent self-transitions in some states in order to avoid exit() and enter() from running while the state did not actually change?

On a side note, setMode() in the ControllerState hierarchy is a bit confusing. The argument of the method (mode) is not being retained by the invoker, rather, an assignment is happening at the outer Class level. Thus, It's semantically incorrect to give this method a Setter naming style. A better name would have been switchMode or something to that effect. Correct me if I'm wrong.