diff --git a/fsm/FSM.cs b/fsm/FSM.cs index 15fc7ce..93e1828 100644 --- a/fsm/FSM.cs +++ b/fsm/FSM.cs @@ -1,6 +1,7 @@  using System; +using System.Runtime.CompilerServices; @@ -41,14 +42,22 @@ public class FSM State.onEnter( Context, state ); } - public void Transition(ST newState) + public void transition(ST newState, string reason = "", + [CallerMemberName] string member = "", + [CallerFilePath] string path = "", + [CallerLineNumber] int line = 0 ) { + log.debug( $"{GetType().Name} switching to {newState.GetType().Name}from {State.GetType().Name} bcs {reason} Code {log.relativePath(path)}:({line}): {member}" ); + State.onExit( Context, newState ); newState.onEnter( Context, State ); State = newState; } - - } +/* + +Im going to preface this with, I use FSMs everywhere for quite a few things. + +*/ \ No newline at end of file