本文整理匯總了C#中StateMechanic.StateMachine.FormatDgml方法的典型用法代碼示例。如果您正苦於以下問題:C# StateMachine.FormatDgml方法的具體用法?C# StateMachine.FormatDgml怎麽用?C# StateMachine.FormatDgml使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類StateMechanic.StateMachine
的用法示例。
在下文中一共展示了StateMachine.FormatDgml方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: FormatsStateMachinesWithNoNames
public void FormatsStateMachinesWithNoNames()
{
var sm = new StateMachine();
var state1 = sm.CreateInitialState();
var state2 = sm.CreateState();
var child1 = state1.CreateChildStateMachine();
var state11 = child1.CreateInitialState();
var state12 = child1.CreateState();
var child2 = state2.CreateChildStateMachine();
var state21 = child2.CreateInitialState();
var state22 = child2.CreateState();
var evt1 = new Event();
var evt2 = new Event<string>();
state1.InnerSelfTransitionOn(evt1);
state1.TransitionOn(evt2).To(state2);
state11.TransitionOn(evt2).ToDynamic(_ => state12);
state12.TransitionOn(evt1).To(state11);
state21.TransitionOn(evt1).To(state22);
var dot = sm.FormatDot();
var dgml = sm.FormatDgml();
}
示例2: FormatsStateMachines
public void FormatsStateMachines()
{
var sm = new StateMachine("sm");
var state1 = sm.CreateInitialState("state1");
var state2 = sm.CreateState("state2");
var child1 = state1.CreateChildStateMachine("child1");
var state11 = child1.CreateInitialState("state11");
var state12 = child1.CreateState("state12");
var child2 = state2.CreateChildStateMachine("child2");
var state21 = child2.CreateInitialState("state21");
var state22 = child2.CreateState("state22");
var evt1 = new Event("evt1");
var evt2 = new Event<string>("evt2");
state1.InnerSelfTransitionOn(evt1);
state1.TransitionOn(evt2).To(state2);
state11.TransitionOn(evt2).ToDynamic(_ => state12);
state12.TransitionOn(evt1).To(state11);
state21.TransitionOn(evt1).To(state22);
state21.TransitionOn(evt2).To(state22);
var dot = sm.FormatDot(colorize: true);
var dgml = sm.FormatDgml(colorize: true);
}