Looking for an "OnTransitioned" eventhandler example

221 views
Skip to first unread message

mabra

unread,
Jun 7, 2013, 7:52:12 PM6/7/13
to dotnet-state-ma...@googlegroups.com
Hi All !

I see the pattern, but not right. If I see this long expression, I cannot understand it.
If I see this:

public void OnTransitioned(System.Action<StateMachine<TState,TTrigger>.Transition> onTransitionAction)

and this:

public Transition(TState source, TState destination, TTrigger trigger)

I cannot bring this together. A simple eventhandler [ with += ops] would be much simpler.
I wrote a method:

private void OnChange(State state1, State state2, Trigger tr)

and assign it to the stateengine this way:

this.sm.OnTransitioned(this.OnChange);

but this does not work. I am getting errors, most are this ones:

cannot convert from 'method group' to
'System.Action<Stateless.StateMachine<AnimationStateMachine.AnimationState,AnimationStateMachine.AnimationTrigger>.Transition>'

Any simple example, at best without lambda expressions, would be of great help to me.

Thanks anyway and
best regards,

++mabra

mabra

unread,
Jun 8, 2013, 10:27:42 AM6/8/13
to dotnet-state-ma...@googlegroups.com
Ok, have it.

this.sm.OnTransitioned( this.OnChange );

private void OnChange( Stateless.StateMachine<AnimationState, AnimationTrigger>.Transition trans )

Have not seen, what Transistion is. Each time, I type this inside Visual Studion, it does not
find the type ....

Best reagrds,

++mabra
Reply all
Reply to author
Forward
0 new messages