public FsmBuilder State(Enum id, Action <StateBuilder> stateCallback)
        {
            var builder = new StateBuilder {
                Id = id
            };

            stateCallback(builder);
            _stateData.Add(new StateData {
                id       = id,
                callback = stateCallback
            });

            return(this);
        }
        public IFsm Build()
        {
            var       fsm          = new Fsm(_owner) as IFsm;
            StateData defaultState = null;

            foreach (var state in _stateData)
            {
                var builder = new StateBuilder {
                    Id = state.id
                };
                state.callback(builder);
                fsm.AddState(builder.Build(fsm));

                if (Equals(_defaultState, state.id))
                {
                    defaultState = state;
                }
            }

            SetupDefaultState(defaultState, fsm);

            return(fsm);
        }