X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=nucleus%2Flibrary%2Fprocesses%2Fstate_machine.cpp;h=e2f7150dc4809960361a5c36c37cb923591e0a8b;hb=f5d845d81352418af0785b85412a35888c82486f;hp=cb0a2d6508dc9bf647bc4128e2d305831312004b;hpb=f052ba2390ff60901350d2a346c6e2f5d233b13d;p=feisty_meow.git diff --git a/nucleus/library/processes/state_machine.cpp b/nucleus/library/processes/state_machine.cpp index cb0a2d65..e2f7150d 100644 --- a/nucleus/library/processes/state_machine.cpp +++ b/nucleus/library/processes/state_machine.cpp @@ -75,20 +75,39 @@ struct override { int current; int next; int duration; : current(_current), next(_next), duration(_duration) {} }; -struct transition_info { - enum transition_type { SIMPLE, RANGE, TIMED }; - transition_type type; - int next_state; - int low_trigger, high_trigger; - int time_span; - - transition_info() {} // blank. - transition_info(int next) : type(SIMPLE), next_state(next) {} - transition_info(int next, int time) : type(TIMED), next_state(next), - time_span(time) {} - transition_info(int next, int low, int high) : type(RANGE), - next_state(next), low_trigger(low), high_trigger(high) {} -}; + struct transition_info + { + enum transition_type + { + SIMPLE, RANGE, TIMED + }; + transition_type type; + int next_state; + int low_trigger, high_trigger; + int time_span; + + // blank constructor. + transition_info() + : type(RANGE), next_state(0), low_trigger(0), high_trigger(0), time_span(0) + { + } + + transition_info(int next) + : type(SIMPLE), next_state(next), + low_trigger(0), high_trigger(0), time_span(0) + { + } + + transition_info(int next, int time) + : type(TIMED), next_state(next), time_span(time), low_trigger(0), high_trigger(0) + { + } + + transition_info(int next, int low, int high) + : type(RANGE), next_state(next), low_trigger(low), high_trigger(high), time_span(0) + { + } + }; struct state_info { int state_id; // id for this state.